source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
Optocoupler Issue - Not sure why it isn't working - help needed I have used an optocoupler/isolator before in a similar circuit, can't figure out why it isn't working in this instance, any help would be much appreciated. I am using the Siemens SFH615A, link to spec below, and the following circuit whichI am using to ground an Inhibit signal on a Servo drive. http://docs-europe.electrocomponents.com/webdocs/009c/0900766b8009c194.pdf Very much a newbie with electronics, any help would be great, thank you. Inhibit line when grounded stops the servo drive from powering a connected motor.When the line is left open the drive is enabled.Output voltage of the Inhibit line is 3.56V. <Q> Note: You are driving that poor LED <S> very hard with 60mA typical current (the absolute maximum number). <S> I would suggest increasing the resistor to <S> at least 300 ohms- but more information on the VFD input is required to determine if that is okay or not. <S> Possible consequences include rapid aging of the LED (the isolator will weaken in CTR over time) or sudden failure of the LED. <S> Note that the CTR is specified at 1mA and 10mA. <S> If you have no info on the VFD input you could test it at (say) <S> 2mA and if it works go to 10mA <S> (add some at least 2.5:1 safety margin to account for time and temperature changes). <S> When the switch is closed (LED should be energized) do you measure voltage across the 62\$ \Omega \$ resistor? <S> If not, there is no current flowing and the LED cannot work. <S> Possible reasons include wiring, a bad component, lack of 5V supply or (more likely) <S> the LED is connected backwards. <S> Measure the voltage across the LED- it should be about 1.25V. <S> Assuming the LED is conducting and the drive input is the type that accepts a dry contact, there should be some positive voltage present at the transistor collector (several volts) when the switch is open (or when the opto is disconnected). <S> The voltage should decrease to much less than 1 volt (still positive) when the switch is closed. <S> If that is not happening, there is something strange with the input, the opto-isolator has been damaged, or (more likely) <S> the transistor is wired backwards (emitter must go to ground). <S> It's not so common with industrial equipment, but a link to the manual would help. <S> Why is the opto in there? <S> Will the switch not work by itself? <S> Or is there some mains isolation issue? <A> Is there any voltage on Inhibit signal on a Servo drive when opto-isolator is not connected ? <S> If there is nothing there - your schematic ain't gonna work. <S> This may be fixed by adding pull-up resistor from INHIBIT Line to appropriate voltage at Servo drive side. <S> More details require knowledge of your servo model and connection schematic. <A> Well I think your problem mus be the wiring or the optocoupler itself. <S> You can perform the following tests: Test the device (unconnected): a) <S> Use a multimeter in the semiconductor test option (set the knob to the diode symbol) and measure with it the forward voltage across the LED (red probe to pin 1 and black probe to pin 2 of the opto). <S> It MUST display between 1.0 and 1.6V (It is typically 1.25, see vishay datasheets). <S> If you have something near 0V the opto's LED is short-circuited (burned up) and it's because the low resistor value (I use a 220 ohm resistor to this kind of circuit). <S> b) <S> If the LED is still alive, test the photo-transistor: With the multimeter knob in the semiconductor test option (set the knob to the diode symbol) measure the voltage across the output transistor (red probe to pin 4, black probe to pin 3) in two times: <S> first with the four pins unconnected multimeter MUST display no measure (normally 'OL' = open loop or '1 .' <S> = measure too high). <S> Second, measure as the first but applying the 5V through the 220 ohm resistor to pin 1 and connect pin 2 to ground (pins 3 and 4 unconnected). <S> Multimeter MUST display 0.1V to 0.4 (typically 0.25 according the vishay datasheet). <S> If this is correct then step 2. <S> Test the wiring: It's very simple. <S> If step 2 works then the input wiring is ok. <S> Test the output wiring with a short-circuit between pins 3 and 4 with everything connected (no multimeter needed) and the servo drive MUST react. <S> If no, there is your problem. <S> Hope <S> it helps
Some inputs are not designed to accept a contact (such as a mechanical switch) to ground and require a logic input-- which means you need a power source on that side of the LED.
What is the difference between a 12V and 24V DC motor? I was buying DC motors for making robots. I wanted to ask whether the voltage written on the motor, e.g. 12V or 24V, matters. Whether a 100 RPM 5kg/cm torque 12V DC motor is any different from a 100 RPM 5kg/cm torque 24V DC motor. If I give 24V to a 12V motor, then would it be a problem, or would it not accommodate 24V and finally perform as it would have performed on a 12V power supply? Or would a 12V motor perform better on 24V than it does on 12V? <Q> In other words power supplied to both motors should be quite similar for a given mechanical load. <S> Mechanical load power is defined as \$2\pi n T\$ <S> where n is speed in revs per second and T is torque is newton-metres. <S> And if the 12V motor took 4 Amps to supply a certain mechanical power output then the 24V motor would take 2A to perform identically. <S> DC motors of the simple type (trying not to generalize here) will rotate at full speed on no-load and this speed is mainly determined by the applied voltage. <S> Putting 24V on a 12V motor may wreck it. <S> Conversely, on heavy loads, the speed normally reduces fairly linearly with torque but on a 24V supply there may be enough potential for the motor to fry due to it being able to supply more torque and speed. <S> Don't do it <S> is my advice. <A> If i give 24v to a 12v motor, then would it be a problem <S> Yes, there will very likely be smoke and possibly fire. <A> Your solution may be gearing and not power, because adding more power to or potential to your motor will not end well. <S> Volts is a measurement of potential difference if the engineers and manufacture intended to make your motor a 24 volts they would have changed the design and materials. <S> Amps are the amount of flow so adding more flow is not going to help it perform. <S> Think of your car or truck <S> , you have a 4 cylinder motor and a transmission. <S> Your transmission helps give your car more or less torque depending on how fast wheels are turning or you are trying to accelerate. <S> If you were able to add a fuel pump that is double of your 4 cylinder, you are not going to make an 8 cylinder motor, the motor may not be able to even hold all the gasoline <S> and you have a big fire on your hands. <S> Because your 4 cylinder motor can only hold so much gas and burn so much safely no matter the amount you try to add to it. <S> If you are restricted to a 12 volt 2amp motor, look for a gear box that make be able to work with your requirements. <S> You may have to redesign your device so a lower motor will work. <S> Hope <S> this helps. <A> Amongst the hazards of over-volting a permanent magnet motor are <S> a) overspeed - will only 2x overspeed burst the armature? <S> Probably not, but the centripetal force is 4x rated, so it is possible. <S> b) <S> excess current taken at standstill - the heating effect of this is the least of your worries. <S> Most PM motors are designed so the magnetic field the armature generates when supplied with rated voltage and stationary, that is the conditions you'd get starting at full volts from standstill, will not be sufficient to demagnetise the field magnets. <S> The margin for error is not large, double the rated standstill current <S> may be enough to demagnetise, and therefore ruin, your motor. <S> As a robot builder, I often overvolted my 24v motors to 36v for a bit of extra speed, and used a current limited controller which was set to not exceed the rated standstill current. <A> One important point - most often, higher voltage is given to the motor to get higher torque. <S> Motor being inductive load, the current rise is not as soon as the voltage is applied by gradually builds-up (in milsec).However, important point is to make sure that there is proper circuit to monitor the current and cut it off when it reaches the threshold. <S> Most dot-matrix printer stepper motor circuit used to provide 24V to 12V Stepper motor - <S> but nothing happens as the design takes care of the current limiting. <S> However, when the transistor / circuit that is used to limit the current short-circuits for whatever reason, the entire PCB get sort of burnt. <S> If you are a beginner, better to stay with 12V for 12V DC motor and not fry the circuit.
On their respective power supplies both motors should perform identically but the 12V motor would draw twice as much current from its 12V supply compared to the 24V motor on a 24V supply. Torque of a DC motor is dependent on the voltage.
Can the resistance between two points in air be calculated? How? If I have just a battery, the terminals are separated by air, a very good insulator. We can say, practically, that no current flows. However, air has a very large, but finite resistivity. Wikipedia gives a range of \$1.3\cdot 10^{16}\$ to \$3.3\cdot 10^{16} \Omega \mathrm m\$, which I'm sure varies by pressure, temperature, humidity, pollutants, and so on. From that, can we calculate the resistance between the battery terminals, knowing the dimensions of the battery, and assuming that there is an infinite space of air around the battery? What's the math? Could this be extended for calculating the resistance between two points in an arbitrary material, of infinite volume, with a known resistivity? The practicality of obtaining an infinite volume of a thing aside, I'm wondering how resistivity relates mathematically to idealized volumes of things that aren't extruded blocks of things. (That is, not \$R = \rho L / A\$.) <Q> It's more likely that the surfaces of the battery will form a better conduction path than the surrounding air. <S> For instance, the surface resistivity of Nylon 66 is about \$10^{11}\$ ohms per square. <S> See this document for other common plastics. <S> Given the formula for volume resistivity (R = \$\rho <S> \cdot <S> L <S> \over <S> A\$ <S> ) you could calculate what an equivalent volume of air would introduce "in parallel" with the surface resistance of your battery enclosure. <S> Given that non-humid air doesn't cause a significant error when making surface resistivity measurments it's probably reasonable to assume that the dominant conducting material around the terminals of your battery is the surface of the battery's material and not the air. <S> So, I would say that it is an interesting but fruitless exercise to calculate the resistance of air. <S> How would you calculate the resistance of a volume of air given that the resistance between two points may be X? <S> See also Phil Frost's attempt at humour in one of his comments LOL <A> Just a note: the resistance between two points in space is highly dependent on the geometry of the space. <S> Even things far away affect the electromagnetic properties of things close by, which means the approximation isn't very good except for wide open spaces. <S> Ok, so to get the resistance in the setting you mentioned you also need to factor the current emitter itself. <S> It makes no sense to ask the resistance between two points if the full geometry of the problem isn't specified (and this includes the battery). <S> In practice (or is it theory?), this means you have to e.g. model your two points as charged spheres with a constant +I/-I into them and solve Maxwell's equations. <S> If you shrank you spheres too much, the current would inevitably be concentrated in a too small area, and you get rapidly increasing resistance. <S> Edit: I forgot to add that because of the linearity of Maxwells equations in simple media with uniform conductivity like the models I exemplified, the final resistance is going to be simply proportional to the conductivity <S> (a simple subdivision argument will convince you of this), so you can compare different (linear/homogeneous/etc) conductors directly. <A> You could calculate the resistance of a rectangular block of any material from the formula R = \$ <S> \rho \cdot <S> L <S> \over A\$, where L is the length of the block and A is the cross-sectional area (all in consistent units, obviously). <S> That's assuming two conducting sheets at each end. <S> Actually calculating the resistivity between two electrodes of arbitrary shape immersed in a sea of conductor would probably have to be done by a numerical method such as using a field solver. <A> Doesn't quite make sense to look at it this way. <S> You need to break up the air into a comparmental model, and use numerical methods to solve it (unless you can see a nice closed form solution. <S> It might make more sense to think of it as a current or voltage field in a distributed resistivity. <S> This is the way to thing about two electrodes in biological tissue. <S> Might check out http://www.cmu.edu.cn/jcyxy/upl_files/20081122184243806.pdf
In other words, the resistance between any two points assuming pointwise sources is infinite -- which shows mathematically that asking "what is the resistance of the air" is incomplete -- you need to specify everything. However, all the notes that I find on recommendations for measuring surface resistivity suggest that the air must not be humid when taking measurements as this will lead to errors.
Power supply from USB connector The power supply from a solar charger board has USB connection. But on my sensor board, I need only the V DD and GND. Can I simply cut one end of the USB cable and connect the V DD and GND wires to my sensor board? <Q> Assuming your sensor board takes a 5V input, then yes. <A> If your solar charger board requires communications with the target USB device (to be charged) before it applies power then no. <A> Assuming you are taking less than 100mA then this will almost certainly work. <S> However its not allowed according to the USB specification. <S> A fully compliant USB device should enumerate when it's connected. <S> This is a process where the device tells the host (in this case charger) <S> what it is and requests the current it needs. <S> A device should take less than 100mA while this process takes place then may take more (up to 500mA) once its enumerated provided <S> the host says its OK. <S> Full details on the USB.org website <S> The charger would be within it's rights to disconnect you; however, I have yet to find any that actually do.
If you fail to enumerate (which you will, since it's not a true USB device) you are supposed to disconnect and take no current.
What is this electronic symbol labelled "Current Source"? What is this electronic symbol? How do I physically implement this? simulate this circuit – Schematic created using CircuitLab <Q> When dealing with circuit schematics, an arrow inside a source means that it's a current source, as opposed to a voltage source. <S> The diamond shape means that this is a controlled source. <S> Since the gain makes no mention of amps/volt, this is a current-controlled current source. <S> The gain is one, so this is actually a unity-gain current-controlled current source. <S> An example of a device like this would be a current mirror, where current running through one leg of a device causes an equal current to run through another leg of the device. <S> An advantage of this device is that it acts as a buffer, preventing the output circuit from loading the input. <S> From wikipedia ( http://en.wikipedia.org/wiki/Current_mirror ) simulate this circuit – Schematic created using CircuitLab <S> Basically, the current mirror shown here acts as a current to voltage, then voltage to current convertor. <S> Current flowing into Q1 is converted to a voltage at the base terminal. <S> This voltage then determines the current flowing through the base of Q2, which sets the current flowing through the collector of Q2. <S> It's a fairly common circuit, and you should be able to find it in any undergraduate level electronics textbook, as well as any decent resource online. <S> Other implementations exist, and a search online will probably turn up many circuits you can use. <S> Edit: <S> Resistor values, transistor part numbers, and voltages are just the defaults in the schematic capture program StackExchange uses. <S> You'll need to do a little math to get a circuit that will work right for you. <S> Note that the above circuit is a very basic circuit, like you would find in a textbook. <S> More practical circuits definitely exist. <A> This symbol stands for a dependent current source. <S> It's also called controlled current source. <S> The dependent current source is still ideal, even though it's not constant. <S> This symbol is often used for illustrating how active components (transistor, OpAmp) function. <S> A schematic with this symbol should explain what the current depends on and what the dependency equation is. <S> Here's an example from a textbook. <S> Schwarz & Oldham Electrical Engineering: <S> An Introduction ISBN 0-19-510585-0 <A> It's a constant current generator and the Howland current pump is usually reckoned to be the best because it can both source and sink current: - Set Vin+ and Vin- <S> and I out (for this particular set of resistor values) is \$\dfrac{V_{IN+}-V_{IN-}}{1000} amps \$. <S> Another one I like is this: - <S> It only supplies current from the top rail but it can supply several amps if the resistor values are chosen correctly and a heatsink is applied to the final transistor output stage. <S> Here's a random collection of other current sources that can be found: - Number 3 is quite useful because it uses hardly any compoennts at all and the LM317 is easy to get. <A> An ideal current source will supply a specified current to any load and change the output voltage to make sure the current is delivered. <S> In reality there are limits. <S> In practice the current source can deliver to a load with: i) <S> one connection at ground. <S> ii) <S> one connection at Vdd (power). <S> Here's a good description on Instructables. <S> It's ground referenced. <S> For a source with a Vdd referenced load, swap the power and ground (but obviously not of the op-amp power) and change the transistor to NPN.
It's a current source.
AC to DC Bridge Rectifier DC Amperage Drop Assuming I used a 120 VAC -> 12 Vac 2 VA transformer and pass the current through a full wave rectifier circuit what is the maximum amperage I could draw on the DC side. <Q> It's a 2VA transformer and "VA" means volts x amps. <S> If your output is 12V RMS <S> then the current you can take is up to 167mA RMS. <S> If you take any more current you are beginning to overload the transformer and it may get too warm and eventually burn-out. <S> With or without a full-wave (bridge) rectifier in place, the peak current obtainable without causing problems to your transformer is going to be about 1.414 times 167mA (236mA). <S> This is playing a bit safe and assuming a resistive load. <S> Given that your actual load may only draw short pulses of current, the peak level for that short duration could be double or triple this amount but, without knowing the circuit or the transformer in detail this is just an intuitive guess. <A> If you put a filter capacitor of typical value on the output, the maximum current you can draw is 103mA. <S> Ref: Hammond Design Guide <A> Loss of a typical 2VA transformer is about 0.5W (~0.4W copper + ~0.12W iron). <S> So the available power is reduced to 1.5VABy the definition output current of a power supply is the average current . <S> If we assume that: -Load is ohmic -The output peaks is a sine curve (it is not entirely accurate but sufficient for this purpose) <S> -The ambient temperature <S> it is not <S> more than 45C and maximum temperature rise on the transformer is 70C... <S> then secondary peak voltage is about 17V minus about 1.6V drop on diodes, peak after bridge rectifier is 15.4V and average is 9.8V, then 1.5VA/9.8V=153mA
If you simply pass the current through a full wave bridge and to a resistive load, the maximum current you can draw is 150mA.
Can pwm pulse damage High Side Solid State relay IC ,driving Bulbs as load I am driving a 12V, 10W Bulb and 12V, 5W Bulb (parallel connected) on one channel of high side driver solid state relay IC. For dimming effect, Bulbs are driven by PWM (Intial 3msec) then continuously ON. After some use, the IC channel fails to work. VNQ600AP-E IC spec: Output current (continuous), for each channel IOUT 15A MAX ON-state resistance Ron 35mΩ Current Limitation Ilim 25A Bulb inrush current is below 25A. Can anyone please give explanation, why the IC is getting damaged. <Q> Driver IC part number and link to datasheet would be useful. <S> Bulb link too possibly. <S> Inrush currents can be immense. <S> You do not say what driver voltage rating is. <S> Less likely <S> There MAY be an inductive component. <S> This is not obvious, but a reverse diode across and near loads would check that. <S> More likey. <S> Inrush currents for cold bulbs can be immense. <S> Unless your figure of 25A is from measurement rather than form a specification it could be higher. <S> Having the two bulbs in parallel MAY cause one to come up to temperature slowly if one hogs the current as they heat differentially. <S> This seems unlikely, but ... . <S> 1 Ohm in series is very safe. <S> 0.8 Ohm in series should be safe. <S> 0.5 Ohm in series may well be safe. <S> See below for why ... <S> Current limiting resistor <S> : Load effective on current = <S> Power/Von = <S> (12+5)/12 <S> ~ <S> 1.5A. <S> Effective on resistance = <S> Von^2/P) = <S> 144/17 ~ 8.5 Ohms. <S> To limit driver to 15A max at turn on with <S> ~ 0 cold resistance R = V <S> / <S> I = <S> 12/15 <S> = 0.8 Ohms. <S> This will reduce bulb operating current to ABOUT V/R = 12 / (8.5 + 0.8) <S> ~ 1.3A and power down to VI = <S> 12 <S> x 1.3 = 15.6 (from the original 17.) <S> I said "about" as the lower current leads to higher bulb resistance leads to lower current leads to .... . <S> So maybe a series 0.5 Ohms. <S> But a series 1 Ohm would be very safe and provide a good starting position. <A> What is the turn-on time of the SSR? <S> Edit:It appears the device is not an SSR but a protected high-side driver. <S> In that case, I suspect something other than the lamp load may be causing the failures. <S> What value of TVS (hold-off voltage and rating) have you used for \$D_{ld}\$ ? <A> PWM frequency is 2KHz and minimum duty cycle is 5% <S> 2KHz has a period of 500us, 5% duty is a pulse with a duration of 25us but according to the datasheet the turn on and turn off time (typ) is 40us (with specific load specs but still the drive and delay difference is noticeable). <S> Maybe that is the cause of the problem.
It's possible that the PWM is causing problems if the frequency is too high because the power device spends too much time partly "on", violating Safe Operating Area restrictions. An easy check is to add a series resistor that guarantees maximum driver continuous current rating is not exceeded.
Low Voltage DC controlling 120 AC, with Arduino I'm looking for a type of device I can hook my arduino (micro-controller) to that will control a set of lights that require 120VAC. Basically I will be making a light organ, where the arduino will be processing an mp3 file, splitting up three frequencies, then turning on the set of lights which is set for a specific frequency. Basically making the lights flash to the music. The problem is I can't just use a relay because they have a delay time, and if the music is to fast the lights won't turn off in time. So I need another solution. Does anyone know a device that is low dc voltage controlling 120 VAC, and has a very minimal delay time? <Q> The canonical answer to this is a solid state relay. <S> This is not a good idea because they are counterfeit, but it is a cheap idea. <S> As for the "lights wont turn off in time", I think that will be primarily dominated by the speed at which the lamp filaments cool down. <S> Mechanical relays can disengage in 30-50 milliseconds. <A> These days I'd consider operating the bulbs on a "safe and isolated" DC supply - then you can just use MOSFETs. <S> Obviously, the power supply voltage needs to match the lamps ratings <S> but you'll be safe and they are a lot easier to drive and develop circuits for. <S> Here are other ideas: <S> - From the 70s onwards sound-to-light units used triacs or SCRs for switching the lights on and off: - <S> This is a simple circuit that pulses a lamp when the microphone detects sound. <S> Be aware that this circuit is not isolated from the lethal AC voltages. <S> Here's one that connects directly to a speaker AND uses an isolation transformer <S> : - Solid state relays are OK but many of them do not have fast activation times (just like mechanical relays) <S> - if you are to use SSRs then check the data sheet. <A> As safety is the most important thing in mains switching, and given the level of capability involved in design your own mains circuits, this previous question could be relevant. <S> This is the latest model suggested in that question, utilising TRIAC control. <S> Should be fast and not suffer the failure rate (~100,000 operations) of a mechanical relay based device.
If you aren't switching much power you can use counterfeit Foteks found all over the place on eBay for $3.
Can I use staples to hold down electric wire? I'm building a very small game for my brother. I am moving it from the original, ready-printed motherboard to a sheet of metal. The metal doesn't have holes punched in it, and I need a different way to attach my wire to the sheet of metal. Could I possibly use staples to hold down wire to the metal? I've heard that staples are conductive, and I worry about messing something up. I will look into what kind of metal the metal sheet is, but I don't currently know. If staples would mess anything up, what else could I use? A note: This is my first post on here, and I haven't read through the scope etc. yet. If I did something wrong, notify me and I'll take note on your comments. <Q> What's wrong with this: - What you see above are three things: <S> - Some cables being bound together by... <S> A cable tie-wrap which loops thru a... <S> Self Adhesive, (or screw fixing) <S> Cable Tie Mount <S> Here's a link <S> I'm think a paper stapler wouldn't have the strength to pierce a metal sheet plus you can't really control it from breaking the insulation and shorting several wires in seberal different positions to each other via the metal sheet. <A> Short answer: <S> Yes. <S> Long answer: <S> Yes, but... I have used all manner of thing to attach wires to things: stables, tacks, hot glue, tape, even gum once in an emergency. <S> But just because you can doesn't mean you should. <S> Even if you are careful there is a risk you will piece the wire or nick the insulation. <S> This will cause a short, and could cause all kinds of problems/damage. <S> Staples don't make a great long term solution. <S> They are prone to rusting and corroding, which can end up damaging the wires as well. <S> In your same situation, I might use cardboard or plastic, and then punch holes in it and use cable ties, or the like. <S> Good luck! <A> As an addition to other answers: There is no problem to use staples (or other metal things like nails), but there is always a risk you will destroy insulation of the conductor, which may eventually lead to a short-circuit. <S> It is also necessary you will not destroy the insulation when inserting a holder. <S> This deformation should not be a risk with low voltages (you say you are constructing a game <S> so I do not expect anything higher than 30 Volts), but can be for higher voltages. <S> In your case I would consider gluing the wire to a base, either with a glue or a tape. <S> If this is not good in your case, consider using as a holder something that is an insulator and which is large enough to not move within a box, like a properly cut piece of plastic or wood (large enough to not move loosely, but possible to take away if you need to repair the toy). <S> The most important thing in your work is to secure the insulation, ensuring you will not destroy it in any way, both during construction and later. <S> If you could achieve this, there is no danger to use whatever you want, even staples. <A> I know I'm crazy late, but what I like to do is staple a zip-tie to the surface <S> I'm planning to attach the wires to and then use that to actually hold the wires in place. <S> This can be used to either bundle up the wires or to run them individually, resulting in the wire sitting flush as if it was stapled without running the risk of damaging it.
A staple (or a nail, a screw etc.) uses force to keep the wire stick and this force can deform the insulation. But for a short term solution staples should work if you are careful.
Software to draw waveforms is there any program which I can use to draw waveforms for digital encoding schemes such as biopolar-alternate mark inversion, manchester, b8zs and hdb3? <Q> Wavedrom is a good online tool for this, failing that LibreOffice Calc or Excel with cell borders can get the job done laboriously. <A> I recommend Matlab for this. <S> You will need to learn the Matlab programming language though, but it's a really simple language to learn. <S> If you google around, you can find examples that other people may have already done. <S> For example, here's a link to the Matlab code for manchester encoding: <S> http://www.mathworks.co.uk/matlabcentral/fileexchange/23203-standard-logic-to-manchester-encoder <S> This example is just a transfer function, but Matlab can plot the result for you in just a few more lines of code. <S> For a free version, there is also GNU Octave, which is a near 100% compatible clone to Matlab. <S> There are GUI's for GNU Octave too, to make it look similar to the Matlab UI. <S> Here's what it looks like in GNU Octave: octave:6 <S> > bin2manchester('00001111')ans = <S> 1010101001010101octave:7 <S> > <S> EDIT: <S> Ok, here's the plot octave:16 <S> > a = '00001111'octave:17 <S> > b = bin2manchester(a)octave:18 <S> > c = b-'0'octave:19 <S> > <S> A = reshape(repmat(reshape(c',1,[]),200,1),[],size(c,1))'octave:20> axis([0 3500 <S> -1 2])octave:21 <S> > plot(A) <A> Could be used to work with vector plots exported from MATLAB, Scilab, OO Draw, Octave etc.
You could try Inkscape , which is a free vector drawing program, decent user community and perhaps some relevant extensions (eg. nicecharts). If you have Matlab or you are a student and can get a lower cost student version, then you can use it to do all your encodings and plot them.
Picking an AC-DC Converter to Minimize Cost I'm trying to design an AC/DC converter to implement into a project I'm working on. The project needs to be isolated from mains and shouldn't require more than 1A at 5V. My question for you is what is my cheapest option for converting 120AC mains to 5V without blowing anything up? Keep in mind this needs to be implemented on a PCB so simply buying an AC/DC converter won't work for me. I'm looking for recommendations on different circuit types and especially component recommendations. (NOTE: I do know the dangers of mains AC. I have a pretty good knowledge of circuit design but I'm a little lacking in the area of power conversion techniques.) <Q> The cheapest option is to copy exactly what is used in the cheapest 2.1A cell phone charger and buy the same garbage parts from the same garbage sources and have them put together in the same illegal sweatshops. <S> They're almost always flyback converter designs, because it's cheapest at low power levels. <S> I've seen such things for < $1 US shipped from China. <S> For bonus points, save money by ignoring UL/CSA/IEC rules on clearances, ignore flammability concerns, avoid using X and Y mains rated safety capacitors, use insulation materials and PCB material from the lowest bidder (preferably returns), don't bother with any EMI considerations, and, since you'll fail anyway, don't bother with FCC and safety agency approvals. <S> Hint: You can buy rolls of "CE" ( <S> Can't Enforce) stickers quite inexpensively. <S> If you actually have needs beyond "cheapest" you could look at reference designs from Power Integrations , some of which are usable by a neophyte. <A> You're going to need a transformer in there somewhere to push 5 W accross a isolation barrier. <S> Rectifying the AC and chopping the result at 100 kHz or more to drive the transformer will save more on the transformer than the extra electronics will cost. <S> Since cost is the primary objective, do a full wave bridge followed by a small cap. <S> Somehow make 100-300 kHz and use that to drive the primary of the transformer. <S> Full wave rectify the output and use a simple opto-isolator to kill the oscillations when the output gets above the regulation threshold. <S> At 5 W out you can afford some inefficiency without it adding lots of cost, like a heat sink. <A> or you could wind your own). <S> Here is the link for the transformer supplier and the list of transformers they do. <S> The data sheets look good and they also include the typical circuit using the power integrations device: - Here is the device that looks about right for the voltage and power level you require: - <S> In quantity the TNY255G is about $1 (according to digipart). <S> I've used a slightly more higher powered device from these guys on a unit that was shipping 5k per annum and only remember 1 failure in two years.
Power Integrations do a series of cheapish off-line switching regulator chips and Premier Magnetics seem to have the transformers to suit (
D flip-flops, but no feedback loops: impossible? Using JK or T flip-flops, it's easy to create a synchronous N-bit counter by cascading them as depicted here: The above circuit has no feedback loops in it. I have run into a situation where I would prefer to use D flops, but I also want to avoid unnecessary loops because of wiring congestion. My intuition says doing both (using D flops and avoiding feedback loops) is impossible, but I can't really put my finger on why. Both types of flip-flops save 1 bit of state, right? Sticking a feedback loop in on top of the D flop feels like adding another piece of state, but the system as a whole doesn't store any extra data. Am I thinking about loops incorrectly? What's different about the D flip-flop that makes it not work here? Last and most important, is it actually impossible to make a counter using only D flops and no feedback loops, or am I just too close to the problem to see it? Edit to clarify my question: Both D and T flip-flops have some kind of internal feedback loop; I understand that. Both D and T flip-flops store one bit of information. What is different about the T flip-flop that allows it to be used in a counter without adding more feedback loops? Or, alternatively, what about the D flip flop makes it inadequate for this purpose when used alone? <Q> The D type flip flop needs feedback from its inverted Q output to divide frequency by two. <S> That's the short and long story: <S> - The way a D flip flop works is simple. <S> Positive clock edges latch the state of the D input at the time the edge rises. <S> Therefore by the time the QBAR output has changed state (some few nano seconds later), its previous state has already been latched so there are no glitches. <A> The immage bellow shows the most basic operating logic of a T flip-flop. <S> If you removed the feed back from Q and Q' you get a D flip-flop <S> (And I know, you also have to invert the bit input on the lower and gate. <S> Lets keep it simple, ok?) <S> So when you go to use a D flip-flop in a counter circuit instead of a T flip-flop, you have to manually add in the feedback that is now missing. <A> If one is willing to make certain assumptions about propagation delays, and can generate a suitable-length pulse from each rising clock edge, a T flip flop doesn't need anything more than an XOR gate which feeds back to itself. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> The circuit above uses RC circuits to add propagation delay to the XOR gate; the comparator at the lower left generates various widths of clock pulses. <S> If a clock pulse is too short, it won't make the output switch; if it's too long, it will switch more than once (as shown, pulses range from being too narrow to switch at all, to being wide enough to switch three times). <S> Note that the default gates and logic buffers in this simulator have Schmidt trigger inputs (which implies the existence of internal feedback) but the analog comparators don't, so <S> the circuit as drawn has no feedback path other than the single wire across the top. <S> In practice, trying to condition clock pulses to be <S> just the right width is impractical, so flip flops add additional internal feedback structures. <S> Such structures require more circuitry, but having a larger amount of robust circuitry is better than having a smaller amount of circuitry which requires precise tweaking to make it work. <A> Every flip-flop inherently has some feedback inside. <S> Consider the very simple case of a R-S flip-flop: <S> Other types of flip-flops start with this basic one and add stuff around it. <A> A ripple-through counter uses T-flops (toggle flip-flops which may be either JK-flops with J and K held high, or D-flops with /Q connected to D) with no feedback between them . <S> They are useful for dividing by powers of 2, can handle high input frequencies limited only by the first flip-flop, but their output(s) do not change synchronously due to accumulating delays. <S> http://en.wikipedia.org/wiki/Counter_(digital) <S> > <S> ** <S> Asynchronous (ripple) counter
To make a T flip-flop, you take a D-flip flop and add feedback from the output to determine the next state.
Class B amplifier with Op-AMP I have been reading the following article about Class-A and Class-B amplifers. http://www.antonine-education.co.uk/Pages/Electronics_2/Amplifiers/Power_amps/further_page_12.htm#Question 1. I am not sure I understand the point of having an Op-AMP in the class-B amplifier !Why do we use a set up pull-push in the Op-AMP's feeback loop?Why don't we just use OP-AMP by itself? And, how does OP-AMP helps to improve cross-over distrotion? Also, in the same article, right above question 3, it states the following: "The op-amp holds the base-emitter voltage of the npn transistor at 0.7 V. When there is a negative signal, the op-amp changes over, dropping 1.4 V, so that it turns on the pnp transistor. The voltage gain is 1, but the power gain is almost infinity." Could someone please explain the above in relatively easier way? <Q> Let's start our with a single op amp and work out way toward a class AB design. <S> Consider the voltage follower. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> In this case <S> \$V_{in}=V_{out}\$. <S> Why? <S> Negative feedback. <S> Negative feedback forces <S> the inverting pin's voltage to match the non-inverting pin. <S> In other words, the op amp will do whatever it takes with its output to make \$V_{NI}=V_{INV}\$. <S> Let's take that a step further. <S> We need more power to drive a low impedance speaker. <S> Well, the average op amp will only have a few tens of milliamps of drive capability. <S> That is where we add the power stage. <S> simulate this circuit By tying the inverting pin to the output of the power stage, we have created a voltage follower. <S> \$V_{in}=V_{out}\$, but now the circuit has the ability to deliver much more current than the op amp output ever could. <S> Because the op amp has negative feedback, \$V_{NI}=V_{INV}\$. <S> The cross over distortion is eliminated by the op amp doing whatever it takes to satisfy that relationship. <S> As an exercise, build this up on a bread board, put a sine wave into \$V_{in}\$, and observe the output of the power stage and output of the op amp. <S> The two will not look anything alike! <A> On the other hand an op amp is almost perfect at producing a clean output. <S> The trouble is, an opamp can't supply any serious power to a load but, in conjunction with a class B amplifier it can. <S> Because, theoretically, an op amp has infinite open loop gain, when the loop is closed around a class B push <S> pull stage it can compensate for the class B crossover inadequacies. <S> In reality, as frequency and amplitude demand rises, a normal op amp struggles to overcome cross over distortion <S> but there are plenty of amps out there that do a reasonable job in this configuration. <A> The funny thing is was looking for the answer myself, here is my understanding adding on to Matt's answer. <S> The Class B and Class AB circuits are both in common-collector configuration. <S> The voltage gain, Av = roughly 1 <S> It has very high input impedance <S> As a result:Sorry that should read V(in) <S> Where Ai is the current gain,, In is the input signal, Vin is the input voltage, Rin is the total input resistance for the AC analysis. <S> So the current gain increases and the input resistance is increased. <S> And: <S> Ap is: So having a Class B or AB increases the current gain which is what is needed to operate the speakers. <S> And, in increasing the current gain we are also increasing the Ap, which is the power gain. <S> And, we can go one step further and say that the power gain is increased as the input (Rin(tot)) is increased. <S> I hope any answer helped. <S> It certainly cleared up my misunderstanding.
Without biasing, a class B output stage is going to produce cross over distortion.
Input Protection for an Electronic Load I'm currently working on a dummy load designed for testing small power supplies less than about 10V. I'd like to provide reverse input protection to prevent the op-amps from being damaged. Because the load has to measure the input voltage (constant power and resistance operation), the voltage drop across the input protection needs to be as small as possible. I've thought about using a P-channel MOSFET, but that requires that the input voltage be above the MOSFET's Vgs threshold, which would be above the minimum voltage I want this load to be able to test (under ~1V ideally). Also, this would cause large voltage drops and power dissipation when the input voltage is near the MOSFET's Vgs threshold. Another solution I've seen is a zener with a fuse/PTC. PTCs are too slow to trigger and fuses have to be replaced, so that doesn't seem to be a great solution. The simplest solution that I can think of is a single diode, but this is also not ideal because of the rather large voltage drop (min. of about .3v with a schottky). Here is my current circuit: simulate this circuit – Schematic created using CircuitLab I appreciate any ideas you all have to offer! EDIT: I forgot to mention that this IS NOT powered from the power supply under test. It's going to be battery powered so I'm thinking 2 3v coin cells in series regulated to 5v. Also, I don't think I was clear about what I meant by using a P-Channel MOSFET: https://www.circuitlab.com/circuit/bka32t/p-channel-protection/ <Q> You'll want to put a 10k resistor in the path from the FET source to the -ve input of the op-amp. <S> You don't want that directly connected there, and you're only sensing voltage. <S> However, be careful of the input bias on this op-amp, it will causes a voltage drop across the 10k and add error, so choose a resistor that is low enough to not add significant error to your voltage sense, or a precision opamp with low input bias currents. <S> You also want to put a 10 ohm up to 100 ohm between the opamp output and the gate of the FET. <S> The op amp doesn't want to drive the capacitive gate and <S> the 10-100ohm there along with the gate capacitance forms a pole that stabilizes the loop. <S> Some people like to add extra capacitance from the gate to GND if the loop still oscillates and they need it even slower. <S> Note that when the load is connected in reverse the body diode of the MOSFET is forward biased, and the sense resistor and MOSFET is in the current path. <S> This will be high current and you can sense that, and you can also sense it's in reverse by the polarity across the sense resistor. <S> Furthermore, you cannot power these from the LOAD. <S> you must have independent power for the opamps. <S> You can share a ground, that's all. <S> For a more advanced design, you can float the output section and power that from a separate supply. <A> For reverse-voltage protection, you could consider (conceptually) something like this. <S> Diodes are the inherent body diodes of the N-channel MOSFETs, not discrete components. <S> Each input could go negative as much as one (body) <S> diode drop <S> so some biasing may be necessary depending on the amplifier/comparator, perhaps a resistor to ground on each input of the comparator and a resistor to +5 to bias the input above ground. <S> Some amplifier/comparators may require only a divider network. <S> Anyway, if Vx is negative, then the output of U1 is ~0V <S> so Q2 stays off, and Vx can be as high as the breakdown voltage of Q2 without causing damage (assuming R4, R5 are high enough to avoid damage to U1). <S> If Vx is positive more than a few mV, then Q2 turns on fully, adding only milliohms to the circuit. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> If you have op amps in your dummy load then you cant power them from the power supply your testing if it is only providing 1 volt. <S> This has to mean that your dummy load has an external supply and if it has then what is the problem using that to generate sufficient negative voltage to turn your p ch fet on? <S> Maybe I'm missing something here?
For reverse voltage protection, perhaps you can use the current sense resistor as it is there, and either a depletion mode FET (if you can work out the Vgs issues) or simply a relay. Closing the loop from the MOSFET to the op-amp would be via opto-isolators or signal transformers in both directions.
DC Motor used in cordless drill - is it polarity-sensitive? I have an old cordless drill I've stripped the motor out of. Am I correct in saying all dc motor aren't polarity sensitive? I thought that how you reverse the direction of the motor <Q> Some DC (also called universal ) motors have a stator winding rather than a PM .. they run in the same direction regardless of input voltage polarity. <S> To reverse that kind of motor you have to reverse one of the windings. <S> The latter kind of motor is not very common in cordless power tools. <S> Edit: Given the additional information that this is a Dewalt drill, here is a typical exploded diagram. <S> We're getting off-topic here, and well into repair territory, but looking at the diagram you can see the gearbox/clutch (14), the motor (13), which appears to be a brushed permanent-magnet motor, and the switch-speed controller assembly (9). <S> Applying DC voltage to the motor (13) leads (disconnected from (9)!!- "stripped out" as you said originally) and it should run forward or backward, unless the brushes are worn out or it's otherwise damaged. <S> Applying reverse voltage to the input of what DeWalt sometimes calls a "VSR Switch" (9) will likely damage that module- <S> there's a lot more than a "switch" in there. <S> Applying voltage of either polarity to the motor with it still connected to the output of (9) might well damage the module. <S> As Russell says, the default in design would not be to add cost to every unit in order to protect against this sort of thing. <S> Brushes are cheap (maybe $5), and they do wear out (with similar symptoms to what you describe), so maybe that was all that was wrong (is wrong) with the motor, so perhaps you need new brushes (and now the VSR Switch (maybe $50)). <S> Video on replacing DeWalt motor brushes: http://www.youtube.com/watch?v=tECeZi6IfvU <S> The VSR switch (9) is a non-repairable module integrated with the trigger switch. <A> A typical "brush"* electric drill MOTOR will reverse direction with polarity <S> BUT if you apply reversed polarity to the assembled drill's battery terminals it may emit magic smoke or behave erratically. <S> This is because the typical speed controller which is activated by the finger switch expects a standard polarity only and the speed control transistor and associated circuitry does not "expect" battery reversal. <S> Drill direction reversal is usually achieved by a mechanical double pole double throw centre off switch incorporated in the speed controller and activated by the side to side motion of the finger operated direction selector. <S> More modern drills MAY use a full electronic H bridge to achieve the same result but still would not 'expect' the battery polarity to be reversed. <S> *Most cordless drills use DC "brush" motors with a commutator. <S> The rotor is a wound electromagnet and the stator is a ring of permanent magnets (often a single ring with multiple sequential NSNSN... <S> poles formed on it.) <S> The commutator and brushes form a mechanical switch which arranges the rotor fields to "point" in desired directions to cause desired direction or rotation for a given polarity. <S> If you reverse the input polarity you reverse the field directions in all cases and, as the stator fields are produced by permanent magnets and cannot reverse, the net interactions are reversed in direction and all forces produced are reversed in direction. <S> So, the motor direction reverses. <S> Many modern devices (but very few cordless drills) use "brushless motors" which usually use a 3 phase set of stator coils and a permanent magnet rotor and so do not need or have a commutator. <S> An electronic controller (the "ESC" = Electronic Speed Controller" of RC model terminology) is interposed between the power connections and the motor proper <S> so how the motor responds to polarity is entirely dependent on the controller design. <S> An ESC could be designed, when polarity is reversed, to: reverse direction, maintain direction, not produce rotation in one polarity or emit magic smoke. <S> The last is the default state. <A> You should try and see what happens, there is almost no change of damaging the motor. <S> Especially if you use the original battery. <S> Some smaller motors, especially the micro ones used in toy helicopters are meant to only spin in one direction. <S> Applying reverse voltage will make it spin backwards, but there isn't as much torque in that direction.
All permanent magnet motors are polarity sensitive.
Converting variable voltage to constant voltage / variable current I'm using solar panels + a micro wind turbine to charge a decent sized LiPo battery using this circuit - http://www.adafruit.com/products/390 . The problem is that the solar/wind stuff will produce a highly variable voltage (anywhere from 0 to 30V+). To feed the ada module, should I be looking at just a switching regulator, or are there other considerations given the high variability of input voltage and current? <Q> The adafruit module looks good <S> but it's only really meant for input voltages below 6V. <S> To maintain efficiency you should use a low drop-out switching buck regulator capable of withstanding the 30Vs you might apply. <S> I'd recommend the AD8610 (mainly because I've used it on two designs) <S> : - It's <S> maximum input voltage is <S> 42V so be aware of this. <S> On one design I put a switch-off-when- <S> the-volts <S> -gets-over-35V circuit with a couple of MOSFETs just to protect it. <S> When you under feed it with voltage it still pretty much acts as a voltage follower be be aware of the under-voltage lock-out it needs to be tied to Vin to get the most out of it. <A> The output voltage will be specified in tech specifications. <S> Also check web for AC to DC or DC to DC step up/down converters as per your requirement. <A> You'll want a dedicated battery charging IC for this <S> so you don't destroy your battery. <S> There are a number available, and without knowing more about your specific setup (# of cells, charging current, etc) <S> the best I can offer is this list of battery charging ICs . <S> The LTC4000-1 looks like it will do what you want, but requires a number of supporting parts: <S> (source: linear.com ) <S> The LT3650-4.1 has a smaller voltage input range, but looks to be much simpler: <S> (source: linear.com )
Yes one can use a rectifier-based DC converter to handle 0 - 30 volts input and rated current.
what IDE and software can I use to program a microcontroller I am aware this sounds like a dumb question, but I'm really unsure what IDE / Software I could use to programme microcontrollers. I have a background in C++ , but I never got to the part where we programmed microcontrollers during my education, so that is why I'm asking here. As an IDE , of course any text editor would do if you know your way around programming languages, but some IntelliSense for C would be nice to have. I currently use VS2013 on a daily basis, but maybe there is some software that can be used as an IDE and can be used to compile code and flash on the microcontroller (I have never tried it, but I'm pretty sure VS cannot do it). I have seen many modules that are sold with firmware that requires you to learn their own language (like BGScript for the BLE1xx modules, or the Arduino boards), but I really do not want to learn a new language. I will try to programme the nRF51822 microcontroller from Nordic Semiconductor and I have read some posts that lead to IAR Embedded Workbench which it's pretty expensive for a beginner like me. I've also heard something about Keil , yet I'm really not sure what to do since my knowledge of this field is far to low. I would appreciate some pointers on where to find my answers if this question is to general or to localised or it doesn't make any sense. EDIT : What are your thoughts on AppCode by JetBrains , some guy seemed to have created C / C++ compilers and IntelliSense support for it here ? <Q> It all depends on what you are trying to do. <S> There is not (to my knowledge) a "universal" microcontroller IDE/Programmer out there. <S> You will need to use whatever your chip manufacturer provides. <S> The IDE's are usually free, or at least there is likely to be a less-featured version offered for free, cause they make money on the repeat hardware sales: the chips themselves, dev boards, programmer/debuggers, etc. <A> Microchip provides their MPLAB IDE for free. <S> This includes the assemblers, librarian, and linkers needed to create code for any of their microcontrollers. <S> Microchip has a broad range of PIC and dsPIC <S> microcontrollers, so with a single IDE you can write code from the smallest 8 bit 6-pin PIC 10F to the higher end 16 and 32 bit PICs. <S> There are also basic version of a C compiler for each micro family available for free, possibly with some limitations on use. <S> If I remember right, the paid version differs in that higher optimization leves are available. <S> However, check the web site for details. <A>
Personally, I use Microchip products at my work and their IDE is MPLAB X. So, pick your hardware first... then check with the manufacturer and get their IDE. Atmel offers a free IDE platform for their AVR micrcontrollers, and from comments on here, other manufacturers also offer free development platforms for their parts.
Converting ~5V DC to 12V DC safely We have an Arduino device that is using a sensor requiring ~12V. Are Step up devices safe? Are there any dangers in terms of current etc? To elaborate; we plan to run the 5v supply from the arduino board through http://uk.rs-online.com/web/p/dc-dc-converters/0389287/ in order to power https://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf as the 5v has proved insufficient. 9v batteries have worked so far, but haven't lasted long enough. Will this work, and how might the circuit look? <Q> Two things to keep in mind: <S> efficiency <S> current Power efficiency <S> : Say you have a 1W load at the 12V end and say you have a 80% efficiency. <S> The 5V end would see a \$\dfrac{1\text{W}}{80\%} = <S> 1.25\text{W}\$ load. <S> Current : For the same 1W load: at 12V side you have a current \$I=\dfrac{P}{V}=\dfrac{1\text{W}}{12\text{V}}= \boxed{83\text{mA}}\$ <S> and at the 5 volt side \$I=\dfrac{P}{V}=\dfrac{1.25\text{W}}{5\text{V}}= \boxed{250\text{mA}}\$ <A> You can't do much to hurt a micro by applying voltages within its power supply range, so one does not have to be all that careful. <S> On the other hand, applying 12V directly to a 5V micro will greatly foreshorten its useful life, sometimes with entertaining sound and odor effects. <A> If you have a 12V bus available, then it's as easy as connecting the output pin to a transistor that connects the 12V to the sensor. <S> If you don't have 12V available, then you can build your own boost converter or use an off-the-shelf part such as MAX771 . <S> Microcontrollers aren't meant to deliver power, so if the pin-end load is more than about 30mA you would need to provide some buffering. <S> You'll also make the chip run hotter. <A> Yes, DC/DC step-up (boost) converters are safe. <S> You'll need to look at current, efficiency and noise. <S> The converter is a switched converter which usually works at around 100kHz levels, which will generate electric noise. <S> The better the converter, the better this noise is filtered (cancelled) out.
5 to 12V step up devices are safe to use. Drawing too much power from a pin could permanently damage it.
Where does U for voltage come from? I believe in Europe the letter U is commonly used for voltage in (eg.) Ohm's law \$U = I × R \$. I think I understand where the letter V came from, commonly used in North America. But what's the story with U? <Q> The best reason I've heard is to avoid this: - V = 2 V (which of course is meant to say "voltage = 2 volts") <S> U = 2 V sounds more sensible after all we use a different symbol for current (I) and also amps. <S> Voltage is a bit on its own - we wouldn't say "amps = 2 amps" or "current = 2 currents". <S> It seems to me this is the sensible reason for choosing U over V but <S> having said that I never use "U"! <S> Maybe I should? <A> I found another explaination here : <S> Germans took freedoms and started calling voltage "U", probably since that letter was largely unused and so couldn't be confused with anything else. <S> They also came up with etymology: U is for Unterschied, which is German and means "difference"; very fitting since voltage is obviously the same as potential difference. <S> So it's U for Unterschied (which means "difference") <A> Voltage is a difference. <S> In German "difference" is " Unterschied ". <S> The chain of thought is that there is a difference in number of free electrons between two places. <S> Electrons that can move are free to move. <S> If there are many such free electrons we call that a "charge". <S> Analogy: <S> Imagine a train with two carriages full of people, say 40 + 40. <S> If a school class (20 pupils) leaves one of the cars, people will move to use empty space and spread evenly in the train. <S> So voltage tells us the difference in number of electrons that can move and spread evenly between two places. <S> Since electricity goes back to Georg Ohm in Germany the explanation fits. <S> Sadly, it is too late to ask late Mr. Ohm if it is true or not. <S> But I have noticed that my students find it helpful. <S> I my teaching <S> I use E for “voltage rise” i.e. source of electrons that are free to move (battery, capacitor) and U for “voltage drops” (resistors). <S> This gives an advantage in analyzing circuitry as now I can compare electrical circuits to things my students are already familiar with like water circulating in a fountain or even income and payments. <A> Doesn't answer where U comes from but here <S> is a similar discussion: <S> Q: <S> voltage symbol u or v? <S> In German Physics books: I = U/R means I[A] = <S> U[V]/R[Ohm] <S> It seems to be that in English you would write: <S> I[A] = <S> V[V]/R[Ohm] <S> Right or wrong? <S> I liked these three comments Radoslaw J. PhD., Eng.; <S> R&D Magnetic and Power Electronic Engineer, Project Leader at ABB PL Corporate Research Center <S> It means that U = V1 - V1 (voltage is a difference between voltage potentials). <S> I agree that in IEEE and American standards voltage is described by "V" letter. <S> Very similar situation is with other electric symbols also (e.g. resistors, capacitors, current sources, etc.), where European and American standards are different. <S> Dejan K. Supervisory Board Member at <S> JP Energetika Maribor d.o.o. <S> Based on experience with writing articles I can conclude the following: For <S> European scientific space U and I are signs for average value of voltage and current respectively and u, i are signs for instantaneous values of voltage and current. <S> U is more appropriate to use not to mix the parameter U with its value in V (volts). <S> Per L. <S> I don't know if US or IEEE standards, or any other standards for that sake, are more rightful than other regional standards. <S> However, I learned to use U for voltage at school <S> and personally I think U = 5 <S> V makes more sense than V = 5 V, but I'm flexible <A> Some German textbooks claim that the origin of the symbol <S> U is unknown. <S> One possible explanation is that it comes from the Latin word urgere which can mean press/squeeze/bear hard/down push/ <S> shove <S> /thrust tread/traverse continually <A> Using V for Voltage would be problematic when working with both units and dimensions. <S> We have a dimension of "length (s,d or l)" with a unit "meter [m]", but having a dimension of "voltage (V)" with a unit of "voltage [V]" would not be fun to work with.
Both of voltage description "U" and "V" are proper, however it must be mentioned that in European notation "U" describes voltage source while "V" describes rather voltage potential.
Is it possible to modify a 5 lead unipolar stepper motor to a bipolar? I would have a question regarding to 5-lead unipolar steppers, I just found in a scanner a unipolar stepper motor with 5 wires and it has a nice gearing on it, so I would like to modify to a bipolar stepper. The stepper motor is TYPE 4H4018S2001 12v 0.4A TECO Made in Taiwan. I took a picture and did a little drawing with the numbers on the coil ends. Could you tell me how to modify it to a bipolar stepper : https://dl.dropboxusercontent.com/u/7511244/unipolar_tepper.pdf I cut the plating on the PCB and found which pair of coils could be separated : wire 7 with wire 3 - ends of two coils; wire 2 with wire 6 - ends of two coils; wire 1 with wire 5 - ends of two coils; wire 8 with wire 4 - ends of two coils; How should I connect in the right way to get only 4 ends? <Q> When I read your post the fist time I missed the fact that you've already cut the traces. <S> From the photo it appears that Node 5 the common 5th wire is brown. <S> The first inductor pair are red-white wires, and the second are yellow-blue. <S> If you reconnect the trace you cut between red-white(around 10 o-clock on the photo) you will have a bipolar config. <S> I'm not an expert <S> so I can't tell you if this would work, but it sure looks worth a try. <A> Your stepper is probably wired like in the circuit below. <S> The • that indicates 'polarity' of the inductor at same direction of current <S> , it defines which end is north, which end is south; Node 5 is common ground. <S> ; L3/L4 are paired on the same pole; L1/L2 are paired on the same pole. <S> When you tie Node 1 to Vcc, Node 5 to GND and leave Node 2 open, then the pole L3 and L4 sit on has a given polarity. <S> However, when you release Node 1 and tie Node 2 to Vcc, the magnetic field will turn around on this pole. <S> The dot of the inductor is on the other side. <S> This also means that both inductors are in series with each other and their fields will amplify when the center node is released, and only nodes 1 and 2 are used. <S> This would mean that the unipolar stepper would perfectly well work as a bipolar stepper with double voltage rating. <S> ... <S> if only the center tap wasn't connected to the center of the L1/L2. <S> Depending on how you drive the four nodes, you may have an issue with the interconnected node 5. <S> As @WoutervanOoijen states in the comments, the center tap shouldn't really be a problem, provided that when a coil is de-energized both ends are disconnected. <S> This is usually the case with an H-bridge, but must be carefully checked for the specific type you plan to use. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> I saw this question last week and it's been bugging me. <S> But I haven't been near a computer since then (only my phone, which sucks for editing). <S> I modify stepper motors from uni-polar to bi-polar on a regular basis. <S> Because you don't have terminal numbers on your coil connections, I'm going to number them according to their position of the numbers on a clock face. <S> Bottom pair of wires comes from the notch at 7:00, next pair of wires comes from notch at 8:00, next pair of wires comes from notch at 10:00, last pair of wires comes from notch at 11:00. <S> This reduces the inductance (as opposed to a series connection) and also reduces the resistance. <S> The reduced inductance allows faster step speed and the reduced resistance allows higher current operation. <S> I strongly suspect that each pair of coils is bifilar-wound with 2 different colored wires: tan & red. <S> That is: both wires are wound at the same time. <S> To make the stepper uni-polar, the tan wire from one end is connected to the red wire of the other end and connected to the common point. <S> I think that one end of phase A is the pair of wires coming from 7:00 and the other end of phase <S> A is the pair of wires coming from 10:00 That would make phase B the pairs of wires coming from 8:00 & 11:00. <S> A simple continuity test will confirm which wires belong with each other (4 coils, 2 wires each). <S> If in fact the coil wires are as I suspect, <S> the easiest way to convert this motor to bi-polar is to connect both wires belonging to a phase to the same solder pad going to the Yellow / Blue wires (phase A) and White / Red (phase B). <S> There wouldn't be any wires going to the common traces on the PCB (Brown wire). <A> If you hadn't hacked the board, the easiest conversion of this motor would be to cut of the wire connecting the tracks near terminal 5 (9 o'clock), and leave the brown wire disconnected. <S> Then you could have connected your bipolar driver A to red and white and B to yellow and blue. <S> You could connect a wire to the spare solder point at 1 o'clock to make a 6 lead stepper motor, once you had cut the connection near terminal 5.
My preference when changing a stepper motor from uni-polar to bi-polar is to wire the coils in parallel if possible. The quick way to find out is to gently un-solder the coil wires connecting to the common traces (brown wire) and ensure that all coil wires are now not connecting to each other.
How to use MQ-2 module? I am totally new to hardware. Recently I bought this MQ-2 module, but I couldn't figure how to get it to work, the on the ship worked but where is the output? I mean the place where I place the voltmeter? This is a picture of it: It has 5 connections (+5v, GND, NO, COM, NC ). <Q> As Peter says in a comment, there's a relay on that board. <S> The output connections include COM, NO and NC connections that are usable as follows ... <S> simulate this circuit – <S> Schematic created using CircuitLab 1 <S> So set your multimeter to resistance (ohms) and connect it from COM to NC. <S> When there is enough gas to trigger the relay the resistance will increase from 0 to infinity (or at least to "out of range" - some multimeters show that as -1) <S> You could use the COM and <S> NO connections to switch on a large and loud siren and/or strobe-light. <S> 2 <S> The board also contains an indicator LED. <S> You can connect a voltmeter across the resistor next to it. <S> When the LED is turned on the voltage across the resistor will rise from 0 to perhaps a few volts. <S> 3 <S> The board has an LM358 op-amp, I guess this is processing the MQ-2 output signal, it might be interesting to put a voltmeter on it's output. <S> See LM358 data sheet for pinout <A> VCC to 5V+ and GRD on negative <S> , that's all you need to do to run this module. <S> On the relay you, you can use it as normally open or normally close, use it as how you would use a switch on a basic circuit like to turn on an AC lightbulb whenever it detects gas. <S> The other pin which are the analog 0 A0 and Digital output DO. <S> You have to get micro controller to use those pins <A> Note:The heater element which can be seen with steel mesh, does not rapidly varies while exposed to LPG, it takes some time to change in its output signal.
Yes the board contains an LM358 op amp to amplify the signal output from the heater element of the MQ2 sensor, this way when it is exposed to LPG/CO2 gases, The output coming out from the sensor also varies, and LM358 op amp is configured as a comparator, thus it drives the relay directly or using a BJT.
Why must Integrated Circuits be baked (in the oven) before being used on a prototype board? Why do integrated circuits mostly QFN, need to be placed in the oven for an hour or so, prior to being used on a prototype board?Is it to somehow improve the protection of the ICs against ESD or just a way of stimulating the silicon? I saw the process being done in an IC design company. <Q> They don't, typically. <S> IPC/JEDEC J-STD-20 provides moisture sensitivity level classifications: <S> MSL 6 – Mandatory Bake <S> before use MSL 5A – 24 hours MSL 5 – 48 hours MSL 4 – 72 hours MSL 3 – <S> 168 hours MSL 2A – 4 weeks MSL 2 <S> – 1 year MSL 1 – Unlimited where the times listed are the component "floor life out of the bag. <S> " If a component is moisture sensitive, it will come in a labelled, airtight anti-static bag, with a moisture indicator strip and desiccant. <S> This phenomena isn't to unique to QFN. <S> This particular example is the label on a bag of white PLCC LEDs. <S> I've also seen it recently on DFN, MSOP, and TSSOP. <S> Parts only require baking if they have been out of the bag outside their floor life out of the bag, or the moisture indicator strip indicates the required humidity has been exceeded. <S> In this case, since my parts are MSL4, from the time the bag was open, they had 72 hours to be run through a reflow oven without being baked. <S> Had the indicator strip come out of the bag like shown, the parts would have needed to be baked prior to reflow. <A> In general, the reason for baking a component is to carefully remove all the moisture from the plastic part of the component. <S> When a SMT component goes through a reflow oven, the temperature of the component (obviously) rises very quickly, causing any moisture inside to turn into steam. <S> This expansion of water vapor can crack the component, resulting in an unusable or crippled board. <S> As indicated in Matt's answer, some components are more sensitive to moisture absorption than others. <S> Once components have absorbed too much moisture, it is a very tedious process to remove the moisture, usually requiring 24 hours or more in a special baking machine. <S> Some of these machines bake the parts in a vacuum chamber, etc. <S> However, if you are just hand-soldering prototypes, there is nothing to worry about. <S> The component body will not get hot enough to vaporize the moisture inside. <S> Unfortunately, many ICs requiring baking are QFNs, BGAs, and other components that cannot be properly hand-soldered. <A> I wonder how likely failure actually is. <S> I've <S> IR reflowed a number of boards that have been sitting around for years (due to BGA problems) using a lead-free (high temperature) profile. <S> Minimal preheat. <S> I did not see any of the hundreds of parts splitting open like weenies on a BBQ. <S> That's not to say one should not follow the maker's instructions to the letter on products for general consumption (particularly if you're in the aerospace or medical fields), but for early engineering prototypes that will never leave the building (and are certainly not part of the ISO quality system) it may not be absolutely essential. <A> On my last order I noticed that my electronics distributor has really stepped up their moisture sensitive devices game. <S> The sensitive parts came in sealed bags, along with desiccant packets and moisture-detecting paper, and instructions to bake if too moist. <S> I wouldn't do it for a breadboard.
I understand why you might want to bake gently before reflow soldering in a much more aggressive oven: otherwise, the trapped water might boil too quickly inside the part, damaging it.
Are wireless links symmetrical in practice? From the top of my knowledge in the theory of EM propagation, two antennas show the same gain if used to transmit from A to B or viceversa, provided that they use the same transmission gain (reciprocity principle). And this holds regardless of reflections, directionality of the antenna and obstacles. But is it true in practice, at least from an engineering point of view? <Q> A linear antenna has the same gain receiving or transmitting. <S> Likewise, the path loss is the same in either direction. <S> This property is called reciprocity . <S> However, most but not all antennas are linear. <S> Some may have losses that increase non-linearly with increasing power. <S> For example, the loopstick antenna is a small loop antenna made of many turns of fine wire around a ferrite rod. <S> The ferrite rod helps concentrate the magnetic flux through the loop, giving the antenna an effective aperture much larger than its physical size. <S> However, the ferrite saturates at even modest transmit powers. <S> It's also likewise possible to construct a propagation medium in which reciprocity does not hold, but it requires a non-linear material. <S> Since most propagation occurs in air which is quite linear, this is more a theoretical problem than a practical one. <S> However, the path and the antenna are not the whole system. <S> There are practical issues that make wireless communication links not symmetrical, meaning if A can hear B, B may not hear A. <S> It's not an uncommon case for one station to have a higher power transmitter, especially when one of the devices is battery powered (cell phones, <S> Wi-Fi, ...). <S> The receivers or transmitters on either end may likewise not have identical sensitivity or selectivity. <S> Furthermore, the different location of each station can lead to asymmetric communications. <S> The hidden node problem <S> you mention is one case. <S> It can also be that there is a source of noise that's close to A, but far from B. <S> In this case, B may hear A, but A may not hear B due to the higher noise floor in A's location. <S> Related is the exposed node problem . <S> These issues of asymmetric link quality are very significant in the design of wireless communications in practice. <S> A common solution is to have the station with the likely biggest, tallest, highest power antenna arbitrate access to the medium. <S> Cellular networks take this approach: the tower tells the phones when they may transmit. <S> Cellular towers also have wired links to each other to further improve their cooperation. <S> It's a much more difficult problem when a central authority does not exist. <S> See for example version two of B.A.T.M.A.N. which was developed primarily to address this problem in its mesh protocol. <A> Just after posting the question I though about a phenomenon that can make the link, if not physically, practically asymmetrical. <S> It's the hidden node problem . <S> If A transmits to <S> B <S> while also C is transmitting, there will be an interference at the receiver, in this case B . <S> When the signal goes the other way around (from B to A ), the interference may prevent B from transmitting but won't affect the quality of the signal at the receiver A . <A> Yes, it is true. <S> This is a fundamental property from physics. <S> If it were not true, you could construct a perpetual motion machine by exploiting the assymetry. <A> I noticed that fast fading was not mentioned. <S> Spatially distributed constructive/destructive interference patterns exist from multi-path reflections between transmitter and receiver. <S> For a device in motion, these manifest as temporal dips in the channel gain (fast fades). <S> Whether fast-fading on forward and reverse path are the "same" depends on several things, among them, whether forward and reverse channel are on the same radio frequency, and whether forward and reverse channel are used at the same time. <S> The question asked about symmetry "in practice". <S> Re fast fading, the answer is No <S> and Yes. <S> Modulation, coding and scheduling strategies are highly optimized to be aware of fast fading. <S> So propagation path asymmetry may indeed be present in the system, but clever designs are immune to this and even take advantage of it so that it is not noticed by end users.
Reciprocity does not hold.
AND, OR gates: 3 transistors. NAND, NOR gates: 2 transistors. Why? Why do NAND and NOR gates require two transistors each, whereas AND and OR gates require three each? <Q> The premise of your question is false. <S> Here's an OR gate with zero transistors and two diodes: <S> simulate this circuit – <S> Schematic created using CircuitLab <S> This isn't an especially good OR gate, but it is one. <S> It doesn't have any voltage gain, for starters. <S> It can be the case that some logic designs require three transistors for an OR gate. <S> For whatever design goals the logic had, three transistors was the best way to do it. <A> Your question appears to be premised on the use of an NPN transistor as the fundamental switching element used to construct the logic gate or function. <S> Ubuntu_noob has shown the three functions (NAND, NOT, NOR ) created with NPN-only devices. <S> However, if the fundamental element is changed from an NPN transistor to a PNP transistor, or NMOS transistor, or PMOS transistor, or CMOS (pairs of NMOS & PMOS transistors), or even diodes, you will find that a different number of those fundamental elements will be needed to form the basic logic functions. <S> In some of these systems the OR or NOR function are "natural" and require the least number of elements to implement (e.g. the Diode <S> OR function Phil Frost provided). <S> In others, the AND or NAND function would require the minimum number of elements to implement. <S> So, it is not universally true that NOR & NAND functions require two transistors, or three for AND & OR. <S> It depends on the fundamental switching element utilizied. <S> You are likely most familiar with TTL-like logic families which utilize on-chip NPN transistors. <S> Or, with constructing logic functions from discrete transistors in which case NPNs are the type most frequently utilized. <S> ( PNP's "missed the boat" for popular use in discrete logic implementation a few decades ago because of cost, so NPNs became the traditional choice, enforced by decades of examples in text books, magazine articles, on-line tutorials, etc.) <A> NAND and NOR with two inputs have an overall effect of inverting their inputs (imagine tying the two inputs together to be one input) so they can be done with one transistor per input. <S> For AND or OR gates, an extra inverter is needed - like "Two wrongs make a right" so that takes an extra inverter. <S> Each input must pass through two transistors. <S> This is assuming the simplest design, using the minimum number of transistors in switching mode, as an amplifier whose output swings from Vcc to gnd (or as close as it can get.) <S> Faster logic will have more transistors, some to pull up the output voltage and some to pull it down. <S> So don't take the transistor count seriously - but the fundamental idea of inverters and needing more transistors for AND and OR logic still holds. <A> simulate this circuit – Schematic created using CircuitLab <S> I have drawn the approximate circuits for you. <S> Please do the math.
It is the nature of the typical transistor to invert a signal. This isn't anything intrinsic to an OR gate: it's just how that particular logic was designed.
My fans are not marked with a withstand voltage between the circuit and the plastic case; what is best practice? I'm designing a new series of products in metal chassis containing plastic fans. The fans' power supply is referenced to the negative DC rail of a variable-frequency drive, and the fans are mounted to the grounded chassis. That means the fan is required to withstand a ~3kV hipot between its mounting holes and its internal circuitry. The fan is not marked with such a rating. However, we have a long history of products using this configuration. Those products are UL-listed, and every unit is hipot-tested before it goes out the door. We've never seen a failure. Is there an industry-standard best practice in this situation? Would it typically be considered acceptable to rely on an unstated voltage withstand, as long as it was tested on each unit? Or would best practice call for the fan to be isolated from the DC- rail (or alternately, insulation to be added around the fan)? EDIT: To clarify, our user I/O is floating, not referenced to anything. (We do prefer to keep our customers alive and not blow up their equipment.) It's only the fan that's in question. The fan is blowing air into the box, so the "guts" of the fan are opposite the fan from the fan grill. And the voltage on the fan is stepped down to 24V from the incoming DC bus. The only high-voltage differential involved is between the fan's internal power supply and the unit chassis. On one hand, I want to say that a history of thousands of units and UL's testing to get the units listed should be sufficient; I think it's pretty clear we don't have a safety issue as long as the user grounds the box and fuses the units as instructed. On the other hand, I hate to rely on an unpublished spec for the fan. Both arguments seem valid. The question is, which one is the more "correct" way of thinking? FURTHER EDIT:The fan I'm planning on using is here: http://datasheet.octopart.com/4715KL-05W-B50-E00-NMB-datasheet-14433727.pdf However, I don't see its relevance. I'm not trying to identify a solution to a design problem. I have two solutions I'm trying to decide between. Which solution is better from a standpoint of best practice ? <Q> From a unit-by-unit standpoint, if it passes hipot today, it should pass hipot tomorrow. <S> As long as each unit passes hipot, you shouldn't have a safety or reliability concern. <S> From a product line standpoint, though, you can't be guaranteed that the fan will always be built the same way. <S> It's possible different production runs will be built differently. <S> Maybe a different plastic will be used, or a different geometry, or who knows what. <S> Since asking the question, I've found out about a case where exactly this happened to us. <S> Many batches of fans passed hipot to our 3000VAC level, well past their spec, and we shipped units with no problems. <S> Then a new batch came in, and every one failed 3000VAC hipot. <S> We had products due out the door, and we had to scramble to insulate or isolate our fans. <S> But as a matter of best practice for a product line , one should not rely on unstated part specifications. <A> It sounds like the power to the fan is derived (without any form of barrier or galvanic isolation) from the rectified incoming AC supply. <S> It's the same argument when your circuit needs a capacitor to earth from either live or neutral AC wire - what sort of component do you use in these circumstances? <S> You use an approved (and UL listed) class Y capacitor. <S> I don't see that there is much of an option other than to galvanically isolate the DC supply for the fan. <S> Your company/firm, as a buyer of components, are not in a position to get the fan approved because you don't manufacture the fan so this isn't a route either. <A> You will have to galvanically isolate the low voltage part from the HV (High Voltage) part. <S> If you value the life of your customers, I recommend insulating the interface electronics as well. <S> You must to cover the air hole for the fan with a mesh to protect against intrusion. <S> If the fan blows out that hole, the electronics will most probably be on the outside, which is close to the mesh. <S> I see no way to insulate the wiring of a normal DC fan with 3 kV against the protection mesh. <S> Putting HV anywhere near a weakly insulated part of your casing or LV electronics is a recipe for disaster. <S> Dont.
Since you probably get power from mains voltage, it is best practice to have case, interface, control etc on safe low voltage, completely separate from the HV part. If it's not a spec listed on the data sheet, you can't assume it will never change from batch to batch. For individual units, you can be fine using unstated specs that you test on a unit-by-unit basis.
How to find out how many sensor you can add to a I2C or SPI protocol? I am having problems to find out exactly how to connect sensors to make a project. The main issue is that I cannot find a device that can drive enough analog sensor, so I need to use either SPI or I2C. Now, I have noticed that some sensor basically has the limitation about how many of them you can connect on the same protocol, since they use a fixed address (forgive me if this is incorrect as explanation, but that's what I grasped, looking at the sparse documentation online). Now, is there an easy way to know which sensor are able to "change" this memory address, so you can use many of them via SPI or I2C? Thanks EDIT: As sensor I am considering these; for the sampling rate I am not sure how to calculate it; I am a SW engineer, not a hardware engineer. The application is real time collection of data related to position and rotation of an object with the equipment on. The speed of the object measured is not faster than any movement that a human can generate. ADXL335 and 345 (the latter has SPI and I2C, the former only analog) http://www.analog.com/static/imported-files/data_sheets/ADXL345.pdf http://www.analog.com/static/imported-files/data_sheets/ADXL335.pdf PArallax MMA7455 Accelerometer http://www.parallax.com/sites/default/files/downloads/28526-MMA7455-3-Axis-Accelerometer-Documentation-v1.1.pdf Bosch BMA180 Accelerometer http://zh.bosch-sensortec.com/content/language4/downloads/BST-BMA180-FL000-03.pdf L3G4200D Gyroscope http://www.pololu.com/file/0J491/L3G4200D.pdf Invesense MPU6050 Gyroscope http://invensense.com/mems/gyro/documents/PS-MPU-6000A-00v3.4.pdf <Q> If you need more addresses than available then you will need to use a I 2 C hub or multiple I 2 C buses. <S> SPI allows as many devices as you can provide nSS lines for, again based on line conditions. <S> A multiplexer such as the '138 can help here. <S> Regardless of which you pick, the more devices you have the slower you may have to run the clock in order to allow enough slew on the clock and data lines. <A> What you say is true of IIC, but not SPI. <S> SPI devices don't have addresses. <S> They each have their own slave select line instead. <S> Power, ground, clock, data in, and data out are common to all SPI devices, but each needs a separate slave select line. <S> As for IIC, some devices have a pin or two to allow you to switch them to one of a set of alternate addresses. <S> However, even with two address select pins, you can still only put 4 of the same devices on the IIC bus without doing some other enable/disable yourself. <A> I get the feeling you are trying to read several (or many) analogue signals (from sensors), possibly with ADCs. <S> If I'm mistaken, sorry. <S> Anyway, there are plenty of ADCs on the market that are SPI compatible AND can have their outputs "chained" so that: - One common start conversion triggers all to begin simultaneous conversion One common clock to them all for clocking out data and One SPI line into your MCU (form the last in the chain of ADCs <S> In effect you initiate conversion to them all simultaneously, wait the appropriate time (busy period while the ADCs are performing the conversion), then clock them all together - the first 12 bits <S> (if it's a 12 bit converter) are from the last in the chain, the next 12 bits are from the 2nd last AND you keep clocking unitl all the "sensor" data is retrieved. <S> Each ADC has an SDI pin that connects to the SDO of the device earlier in the chain. <S> This way, you only need to provide a "strong" clock suitable for all devices (or split the clock onto mulitple pins). <S> LTC2370- 16 is a good example: - <S> Addressing becomes a thing of the past!!! <A> [This started as a comment, but I've run out of room.] <S> Many I2C slave devices have partially fixed addresses (as opposed to purely fixed). <S> Upper bits of the 7-bit address are set inside the IC, lower bits of the address are connected to the pins. <S> You can assign different addresses, depending on how you connect these address pins. <S> This is done to allow individual addressing of multiple devices of the same type on one and the same bus. <S> For an example turn to LM75 <S> (it's a temperature sensor). <S> Its pins A0, A1, A2 set the lower 3 bits of the I 2 C address. <S> So, there can be up to 8x LM75 on one I 2 C bus. <S> The number of address bits connected to pins varies from one I 2 C slave device to another. <S> (I haven't seen devices with more than 4 pins used for addressing.) <S> Some general* comments about I 2 C and SPI <S> * <S> There are exceptions to each of the points below. <S> Neither this list is exhaustive. <S> I2C is better suited for Larger number of slower signals. <S> (E.g.: temperatures, battery voltages.) <S> Communication when time is not critical. <S> (Leisurely reading an external EEPROM on power-up.) <S> environments with little EMI SPI is better suited for smaller number of fast signals (audio A/D and D/A, radio comms) environments with moderate EMI (more industrial) <S> P.S. <S> That said, it's a bit difficult to give our O.P. a solid advice without knowing more about the O.P.'s signals and sensors.
I 2 C will allow you to add as many as there are unique addresses available for the device dependent on line conditions.
Circuit to Detect Floating Signal Line I have a few external input probes on a device I'm making which are connected to an ADC. Is there an electrical (i.e. non-mechanical) method of detecting whether the ADC input is floating/disconnected/tristate or actually connected to a signal source, without altering the input signal? The signal should be considered analog; not necessarily a digital logic signal. The purpose is to ascertain whether the ADC data being read is significant or not, so that the gaps when the probe is disconnected can be noted with respect to time. <Q> If the ADC is part of a typical microcontroller (MSP430, the AVR in an Arduino for example) you will probably find there are optional pullup and pulldown resistors with high values (50kilohms for example). <S> If you enable the pullup only, read the ADC, enable the pulldown only, read the ADC again, and the two readings are very different, you can reasonably conclude the signal is floating without any additional hardware. <S> [EDIT] assuming the ADC is monitoring a slow moving voltage. <S> If it is monitoring high amplitude noise, a single pair of readings may not be enough to make the decision. <S> Nevertheless the pullup/pulldown resistors should pull the signal close to the appropriate rail. <A> Usually with "probes", a pull-up or pull-down can be added that would put the ADC input reliably into what would be unreasonable territory for a working connection (and reasonably quickly). <S> For example, a thermocouple probe might have a pullup of a few tens or hundreds of nA to +3.3V and the ADC going overrange would be interpreted as an open probe. <S> A broken leadwire compensation line on a resistance sensor might drive the signal underrange. <S> It's case-by-case depending on the sensor, and generally these techniques add a bit of error or have other undesired side effects. <S> Certainly these methods are not often practical if you're going straight into a typical microcontroller or other unbuffered ADC input, and imply some kind of signal conditioning that provides a high-impedance input. <A> We use analogue switches to briefly connect a pull-up and a pull-down to signal lines coming into our measurement systems. <S> Normally, all the inputs are scanned but we reserve space in the "frame" to scan one extra sensor input with pull-up and pull-down applied. <S> Thus, if we have 16 inputs (usually thermocouples), we use a 17th measurement slot to be one of the 16 thermocouples retested with pull-up/pull-down. <S> Thus, after 16 frames of data we have acquired all 16 inputs 16 times and will have checked all 16 inputs with pull-up/pull-down at least once. <S> For mulitplexed thermocouple systems this is easy to implement because all the analogue switch multiplexing is in place and you reserve one combination of multiplexers to be active at the same time as your real measurment: - The main multiplxer in the above diagram deals with 6 pairs of inputs (6 shown to make the drawing less cluttered). <S> The output from each multiplxer feeds an Instrumentation amp and both lines can be pulled-up/down with resistors to check cable and source integrity.
If that is not practical, another method that can be used is to briefly apply something like a known current to the input, temporarily disturbing the reading, but allowing the integrity to be tested.
History, reason for and implications of the 2 modes of a modern microprocessor? The modern microprocessors I've dealt with could have 2 modes: User and superuser (and sometimes this difference was just in the manual and not actually implemented like with the Nios II which states that it has 2 modes but only implements 1). Therefore I wonder if this is true in general about microprocessors i.e. it is not very advantageous to add more modes than 2 for instance a third mode that could be "supersuperuser" (which in practice could be that a "supersuperuser" could change the privileges of "superusers") if there could be need for 3 modes? And is it this mode difference of the CPU in modern systems that has caused the design difference between operating systems where some operating systems are called "microkernels" because of their way to load device driver programs in user mode instead of in superuser mode, which is the way of a monolithic os kernel? What is the history about the 2 CPU modes getting developed? It says in another SE comment: I saw the names "user mode" and "supervisor mode" in ARM2 first (late 1980's), So the early microprocessors like Intel 8080 and Zilog Z80 didn't have modes so any program that was run could run any instruction? https://superuser.com/questions/634733/why-so-many-modes-are-in-cpu Are these 2 modes usually implemented in hardware and if so, what does the implementation look like? What is it that changes when a microprocessor switches modes between user and superuser? <Q> When there is more than one independent user on a machine, it is to each user's advantage to take as much of the resources of the machine as possible while leaving the others with nothing. <S> Without some kind of hardware protection, once a user got the CPU he could keep it forever. <S> This was dealt with by having different modes, sometimes called rings or privelege levels . <S> User processes run at the lowest privelege and can not physically take over the machine. <S> This works in conjunction with protections for areas of memory also based on the privilege level. <S> In the most basic form, you only need two privilege levels: user and OS. <S> Historically there have been machines that had more. <S> Four seemed to be a popular number for a while. <S> However, operating systems rarely made much use of more than two privelege levels. <S> Microcontrollers and early microporocessors don't have privelege levels because they are not intended for applications with hostile competing processes. <A> Rather a lot of questions in this question, but I can address some of them. <S> Intel have four modes known as "rings", but two are frequently unused . <S> Intel 8080 and Zilog Z80 didn't have modes so any program that was run could run any instruction? <S> Correct. <S> The privilege separation technique had been invented, but the complexity cost of adding it to microprocessors was large and those processors were used in single-user, single-process systems with no networking. <S> Security simply wasn't a consideration. <S> What it "looks like" depends on where you're looking from. <S> The programmer's guide for ARM shows the programmer's view for that architecture. <S> The electrical implementation may vary - whether the registers are physically swapped out or just renamed. <S> It's necessarily implemented in hardware so that it cannot be circumvented. <A> Almost everything that can be done by having a CPU distinguish supervisor/user mode distinctions can be accomplished with a memory management unit which is external to the CPU and controlled as an I/O device, but there are a few caveats: -1- <S> In general, it is not desirable for user-mode programs to have the ability to disable interrupts, but if user code performs a "disable interrupts" instruction it may be difficult for an external MMU to do anything about it. <S> An MMU could snoop the bus and trigger an NMI if it sees user-mode code fetching a "disable interrupts" instruction, but it would be easier to have the CPU block the instruction itself. <S> -2- Interrupts need to be able to do things which user-mode can't, which implies that when an interrupt is taken the MMU needs to switch out of "restricted user" mode. <S> A unit which watches what's going on may be able to do this, but it's more easily handled in the CPU. <S> -3- User mode shouldn't be able to corrupt the stack used by interrupts. <S> It's possible for interrupt handlers to take care of this even when using an external MMU with a processor that knows nothing about user/supervisor modes, but it's a lot more efficient to have a processor which can switch stack pointers internally. <S> While there can be advantages to having more modes than just user/supervisor, it's often not worth the added complexity. <S> Further, having software emulate more levels on top of a two-level hardware system may be easier than performing such emulation when using multiple hardware levels. <S> PS--while it's bad for user-mode tasks to be able to disable interrupts for arbitrary periods, I've often wished for processors to include a "temporary interrupt disable" counter, and include an instruction which would disable interrupts temporarily (e.g. for the next 8 instructions or so); if the instruction was executed again within the next 8 instructions and an interrupt had become pending, the interrupt would be immediately, and on return the instruction would execute again. <S> Such a feature would greatly ease the writing of interrupt-safe data structures on single-processor machines.
The hardware for a two-level system is simpler than the hardware necessary to work around its absence, but adding more levels complicates hardware rather than simplifying it. The history of this started with timesharing , and the purpose was to isolate user processes from each other.
What are the advantages to a separate processor when there is an FPGA present? Consider an embedded application with both a discrete processor(ARM, AVR, PIC, etc) and an FPGA to offload some of the work or interface with specific hardware. Assuming there are sufficient resources in the FPGA to fit a soft core equivalent of the external processor, what are the advantages of using a hard processor instead of a soft core? <Q> Generally speaking, a hard core will run faster, use less power, and will use less chip area. <S> That may mean that it's cheaper or better to use a smaller FPGA and a hard processor (either on one chip or on two). <S> Some FPGAs have hard cores on chip (for example, the Xilinx Zynq series), so you can use one or both of the two hard ARM9 cores, and/or you could implement a PicoBlaze or MicroBlaze soft (or some other type) processor. <S> There are also most likely business differences associated with licensing IP for a soft core compatible with (say) an ARM toolchain. <A> Another reason that an external processor is sometimes used is that it may be connected to an external interface such as USB or Ethernet and permit product update via a remote download. <S> In these cases the external processor can receive a new FPGA program data file and commit to the FPGA subsystem to implement an update of the FPGA design content. <S> (That might be an update directly to the FPGA or it may be an update to a serial FLASH chip that is interconnected with the FPGA's power-on load scheme. <A> Some of the hard core processors have a more mature development environment when it comes to debugging etc. <S> You can find more programmers that are familiar with the tool chain. <S> On the other hand you might be able to save some space on PCB and a reduced BOM complexity using only a FPGA. <S> It is quite easy to develop a system (FPGA with a SPI-memory) with a bootloader that you can use to upgrade the system in a secure way without using an external processor. <A> Different tasks require different type of tools. <S> You could force the workload of one kind of tool onto another, but over time it tends to become an inefficient way of doing things. <S> In this specific instance, there are plenty of things which are simply easier to do on a processor. <S> You just have to write the requisite code in a relatively comfortable language like C and have a mature toolchain that can compile it. <S> If you wanted to do the same thing on an FPGA, you're starting at a much lower level and first have to design (or otherwise obtain the design for) a processor core. <S> Similarly, the reverse is possible. <S> However, in practice, you usually end up having the work more equally split between the two. <S> It's useful to understand, also, what FPGAs were originally used for. <S> They were (and in many ways still are), generic pieces of hardware which can be used to try out new core designs and specialized circuits with the intention of ultimately turning the designs into ASICs. <S> The reason you're able to ask the question now is because the economics have shifted somewhat in terms of pricing, and there are many applications nowadays which are specific enough to not need the high volumes to warrant production of an ASIC. <S> Still, when there is an ASIC (or even a generic processor), it often proves cheaper, faster, and more efficient in terms of cost, development time, and needed skills to use a combination of an FPGA, ASICs, and a processor than it would be to push everything into an FPGA.
If the bulk of what you need to do needs to be done by the FPGA, and the processor ends up doing very little, you could invest the effort into removing the processor and wedging the core itself into the FPGA.
Replacing 6 series AA alkaline batteries with NiMH batteries – how do I compare possible arrangements to optimise usable capacity? I want to replace a battery pack of 6 AA 1.5V alkaline batteries arranged in series, with rechargeable NiMH batteries in an old transistor megaphone in such a way as to optimise the capacity. The existing battery pack is a typical 2×3 arrangement and it is connected with a PP3/PP6 snap connector. I want to use rechargeable batteries to reduce electronic waste. I'm aware that usable capacity is subject to the device's cut-off voltage, the discharge curve, and the efficiency of the batteries given the temperature and load characteristics. Given that this is an old device and probably not designed with a low cut-off having rechargeable 1.2V batteries in mind, I'm concerned that 6 cells isn't enough and want to include a 7 th . Although I'm aware that rated capacity is a generally misleading figure, I don't understand why my naïve calculations seem to be several times out from what I'd expect judging roughly by the mass/volume of the batteries. Are PP3s really that bad? In the battery compartment there is space for 4 of the following 5 arrangements (see note 2 below) for which I'm demonstrating these naïve, seemingly false calculations. (In the case of arrangement #4, there is also space for a small adaptor I made using 3 snap connectors required to connect the batteries in parallel.) This is roughly related to how ‘big’ the batteries are and relates loosely to their volume, so these arrangements are likely to be applicable to other devices as well. (#) Arrangement Combined Charge Total energy rated voltage capacity capacity[1](1) 6 AA 1.5V alkaline in series 9V 2100mAh 15.12Wh = 54.432kJ(2) 6 AA 1.2V NiMH in series 7.2V 2400mAh 17.28Wh = 62.208kJ(3) 7 AAA 1.2V NiMH in series 8.4V 950mAh 7.98Wh = 28.728kJ(4) 2 PP3 8.4V NiMH in parallel 8.4V 200mAh 3.36Wh = 12.096kJ(5) 14 AAA 1.2V NiMH; 2 series[2] 8.4V 950mAh 15.96Wh = 57.456kJ Note 1: The ‘Total energy capacity’ is a naïve estimation based on the charge capacity and 1.2V per cell mean voltage. Note 2: 14 AAA batteries in a (1+√3)×5 arrangement (i.e. rows of 5, 4, 5) can occupy approximately the same cuboidal space as 2×3 AA batteries. I've included this for the general case; however, in this instance the battery compartment has rounded corners so the arrangement wouldn't quite fit. That is not what I'd expect at all – not even close; PP3s look to be about 2 and a bit times the volume of a AA, so I'd expect the total energy capacity of arrangement #4 to be about 70% that of #2, but this rough estimation suggests 19%! I'm guessing that the rated charge capacity is rated in respect to a ‘typical’ load, so the efficiency of each rating is probably vastly different, and therefore can't be used to reliably determine the actual energy storage capacity which would be underestimated by a different amount in each case. In the case of arrangement #4, the combined internal resistance is halved (i.e. ‘internal conductance’ added), so it would be more efficient and would deliver more energy per battery given the same load, as compared to just a single PP3. In arrangements 1–3 the IRs are added. Arrangement #5 has half the combined IR as #3. For what it's worth, the megaphone is a pulsing load rated 5W maximum power draw, and it's operated outdoors in the UK so the batteries probably generally operate with a temperature between 5°C and 25°C depending on the time of year. I'm trying to find datasheets for the NiMH batteries I use (Maplin L32BJ, L29BJ, and L31BJ for AA, AAA, and PP3 resp.) to actually see for myself the true data of what's going on with these figures, but I haven't yet obtained any. However, specifics aside, these figures seem to be so far out that a better general understanding of how to compare rechargeable replacements for battery packs of 6 AA alkaline batteries would be generally useful because I've seen such battery packs on other types of devices as well. <Q> It sounds like you may have a handle on your question already, but I would like to add a couple of points about NIMH vs Alkaline. <S> You don't say how many watts or how many amps or milliamps your megaphone will be demanding, but the NiMH have a much lower internal resistance and so they can provide a much higher current without dropping their voltage as much as an Alkaline will. <S> At higher loads, a Nimh will provide more power than a Alkaline; at very low loads, an Alkaline will provide more power (a very very loose generalization, but for example, an Alkaline will last forever in a remote control while the NiMH will not last as long - of course there is also the self discharge of many of the NiMH). <S> Also, most NiMH have a NOMINAL volatage of 1.2, but fully charged they start out at closer to 1.4 <S> (I have measured some NiMH fully charged at 1.5) volts, and as mentioned already, hold to the 1.2 volts for most of their discharge. <S> The Alkalines often start closer to 1.6 volts, but quickly lose voltage as they discharge so that their average voltage through their life is about 1.2 Volts! <S> Of course this depends on what the cut off voltage of your Megaphone is. <S> Don't forget that most NiMH have a very high self discharge rate and can lose 10-20% of their capacity in the first day, and 1% of their capacity per day just sitting there and are essentially completely discharged in 3 months or less! <S> There are newer NiMH that hold 85% of their capacity over a year. <S> Check out <S> http://batteryuniversity.com/learn/article/Nickel_based_batteries for more info. <S> As far as your 4 options, option 2 sounds like the best one. <S> Options 3 and 4 have been discussed by others as to why they offer such poor performance. <A> Part of the reason PP3s don't have a good volumetric efficiency <S> is that it uses cylindrical cells inside of the PP3 case. <S> That said, some companies have figured out ways to pack alkaline batteries in a stack making efficient use of the space in a PP3, but they still seem to have the same capacity so I am thinking they did it for ease of assembly rather than giving more bang. <S> Also there is a greater wastage of the zinc used in the case for smaller battery sizes. <S> The zinc case makes up one of the electrodes and must be of a certain thickness to physically hold the cell together and not be eaten through by the electrolyte (which is why cheap batteries with thin shells eventually leak). <S> This is much thicker than is needed for it to act as the negative electrode. <S> In smaller batteries there is a higher percentage of space used by the zinc shell relative to the amount of electrolyte. <A> Just doing a rough calculation of comparable technology Panasonic batteries operated at 30mA constant draw, I get 15h for the 9V and 70 hours for the 1.5V AA cell. <S> Given that the 9V has 6 cells, that's 28% more energy than in a single AA cell. <S> They weigh about double, so the mass energy density is about 2/3 as good for the 9V battery. <S> Not surprising since it has many cell walls and such like inside. <S> The real killer is the $ energy density. <S> In 100 quantity, the AA cell is $0.35, and the 9V battery is $1.90, so the cost of running on 9V batteries is going to be 5-10x higher.
You can't easily make alkaline or NiMH batteries in any other form factor than a cylinder due to the need for compression of the electrolyte.
AC detection for switching to battery source I am designing a DC-powered ceiling fan. Fan is working on AC and I convert it into DC when light is out; we attach a 12V battery so that fan runs continuously. I want to make a circuit which senses that AC power is gone and automatically switches fan supply to the battery sources. <Q> I am designing a DC-powered ceiling fan. <S> I want to make a circuit which senses that AC power is gone and automatically switches fan supply to the battery sources. <S> I assume that the fan has a 120 VAC to ~= 12VDC supply to operate it from mains. <S> If so, easiest of all is to make the mains based supply produce a voltage that is slightly higher than the battery voltage, and feed both supplies to the fan via diodes (Schottky diodes perhaps, but silicon diodes probably OK.) <S> Whichever supply has the highest voltage will operate the fan and the diode to the lower voltage supply will be reverse biased so the lower voltage (battery) supply will supply no power. <S> When the mains supply ceases the battery will automatically operate the fan. <S> See diagram d in second row here. <S> or in commented form below. <S> If "V+ ex line" is greater than "V+ bat" then the top diode will conduct and the bottom diode will be reverse biased. <S> The fan will operate from the top supply and the battery will provide no current. <S> If the mains power is removed the battery will operate the fan via the bottom diode. <S> TYhe series diodes will cause a small power loss compared to operation directly from battery or mains supply. <A> An SPDT relay operated from the AC will do this. <S> However: will the fan run from 12 V dc? <S> I wouldn't expect a fan intended to operate from 120VAC to do anything on 12V DC. <A>
Easiest would be to use an AC relay with form "C" (changeover) contacts (or DPDT if you need to isolate from the line for safety reasons, if isolation is not provided elsewhere).
How to create complex copper shapes in Eagle I'm new to eagle but for a project I need to create a pcb with a complex arrangement of exposed copper contacts. The board is going to be used as a simple touch sensor made up of concentric and radial slices with each slice connecting to a separate pin (a sort of chopped up bulls-eye pattern). We're making the board on an LPKF pcb router which takes in a gerber file generated from a cam file it provides for eagle. Whats the easiest way to "draw" these kinds of shapes into a copper layer?Thanks! <Q> As you can see here, I was successful in creating a copper layer using some obscure shape as the source image. <S> Pragmatically speaking, the design is simple, but it could easily be more complex. <S> Here is the original image: <S> I created the image arbitrarily in MS Paint, and saved it as a Monochrome BMP image. <S> This is important, make sure it is Monochrome <S> (ie two colors only). <S> Then I opened up my library in which I would like to create the part with the obscure contact point. <S> Create a brand new "Package" and then run "import-bmp.ulp". <S> It is a sort of macro that comes with EAGLE. <S> To run it, simply type "run", and you'll be brought to the directory of ulp's. <S> Find the import bmp one and follow the procedure. <S> Only select the black color when moving through the wizard. <S> While following the procedure, you'll be presented with an option to set which layer you want the image to be imported as. <S> You can make it one of the copper layers here, or perhaps a silkscreen layer or whatever else. <S> From there, you could set a pad in the center of the image so that you can have a pad to wire to in your board layout. <S> EAGLE will not recognize your image as a pad <S> so that's why you add the additional pad in a clever place where it will not screw up your design, but so EAGLE knows what pin/pad whatever, that your schematic needs to connect to. <S> Best of luck. <A> You can import vector designs from DXF file into Eagle with the help of this ULP script: http://todbot.googlecode.com/svn/trunk/eagle/import_dxf_polygons_v4.ulp <S> [no connection with the author of the script, found it this morning, worked fine for getting a simple design from Illustrator (exported as an R13 DXF) into Eagle] <A> Once you have drawn your desired shapes, modify the properties of the shapes to be on the appropriate layer. <S> For a 2-layer board, they will be "Top" or "Bottom" layer. <S> After, they should be the same color as the signal traces on that layer. <S> Then use the name tool to change the name to the appropriate net for which you want the shape to be electrically connected. <S> When you first draw the shapes, they will not fill with the color of the layer and will have a dashed outline. <S> Not until you hit the "Ratsnest" button will they become a solid color, better showing how they will appear on the finished product. <S> Once the net is named correctly, any components located in the shape/plane will be automatically connected once the "Ratsnest" button is pressed as well. <S> Note that this is the same process as creating a ground fill if you need to search for more tips. <S> Edit: Per Olin's comment, to make my answer more clear <S> , this is only one way to create complex copper shapes in Eagle. <S> investingating the scripting capabilities of Eagle could alleviate reliance on the GUI icons.
I believe the only One way to draw such shapes in Eagle is to use the wire, circle, arc, rectangle, and polygon tools.
Why don't relays incorporate flyback diodes? Warning: this may be an extremely naive question (if so, please enlighten me). Many applications of relays require a flyback diode to protect against inductive voltage. I'm unable to find any relay that incorporates a flyback diode. Since it's such a common need, why don't relays include a flyback diode inside the relay package? Are there just too many factors to consider, making it hard to guess the circuit's need? <Q> There is simple answer to this question - there are many flyback schematics and the reverse diode is the simplest one. <S> Although it has one big disadvantage - it makes the relay to switch off very slow. <S> This way, sometimes other schematics are to be used. <S> There are several examples: simulate this circuit – <S> Schematic created using CircuitLab <A> There are quite a few relays (also contactors/breakers) which are powered from AC. <S> Putting a diode inside renders them useless for AC applications: - There are several types of relay that are of the latching type and these also require a reversal of voltage - a diode would render this type of relay useless in that application: <S> - See also this answer for high speed switching of a relay. <A> There are relays that include a fly-back diode, but percentage wise, not very many. <S> If you go to this Digi-Key page which lists signal relays (less than 2 amps) and scroll to the right, you will see under the column <S> Features that one of the attributes you can pick are Diodes. <S> Here, only a little over 5% of the relays listed incorporate a diode. <S> For power relays , the number with diodes is a little over 3% of the total. <S> So they do exist. <S> But why so few? <S> This also lets the user select a diode that exactly meets their needs. <S> And it is cheaper (and easier) for a user to add a diode to a PCB (which is an automated process) than the manufacturer add it across a relay coil (which may have to be manually done). <A> There are actually are (or were) a few which have had internal coil suppression. <S> For example this Teleldyne one. <S> They've not been very successful commercially in the general market. <S> Maybe in the automotive market. <S> It probably has more to do with stuff like history and second-sourcing than anything technical, though I fail to see much advantage in putting a diode internally. <S> It forces a polarity on the pinout and results in a sub-optimal electrical life for all users, for a very small saving. <S> There's no PCB generally inside a relay <S> so it would have to be welded or crimped or soldered into place. <A> There is also a reliability problem. <S> Most relays are sealed or, at least, not made to be disassembled by the user. <S> If an internal diode fails, the relay becomes useless. <S> Since the diode cost is much less than the value of the relay, it makes more sense to add the diode externally.
Obviously, it keeps the cost of the relay down, even if the user has to add their own diode.
Can I use a USB-FTDI TTL converter cable as a USB-TTL converter cable? I have the need of a USB-TTL converter cable, but all I have is a USB-FTDI converter cable, that means I have two additional pins (RTS/CTS). If I do not connect RST/CTS pair, will the converter cable act as a USB-TTL converter or won't it work at all ? USB-TTL cable : https://www.adafruit.com/product/954 USB-FTDI cable : https://www.adafruit.com/products/70 <Q> I have the need of a USB-TTL converter cable, but all I have is a USB-FTDI converter cable <S> FTDI is just the brand of the manufacturer, <S> both cables that you shown do the same thing. <S> What you describe as USB-FTDI is a USB-TTL converter <S> The USB TTL Serial cables are a range of USB to serial converter cables which provide connectivity between USB and serial UART interfaces. <S> A range of cables are available offering connectivity at 5V, 3.3V or user specified signal levels with various connector interfaces. <S> All cables are fully RoHS compliant and are FCC/CE approved. <A> Yes, the two cables do essentially the same job and the FDTI cable should work OK without CTS and RTS being connected (in circumstances where neither end is using them for flow control) <A> I'd connect the RTS and CTS pins together just to be certain.
All cables feature an FTDI FT232R device integrated within the cable USB type ‘A’ connector, which provide access to UART Transmit (Tx), Receive (Rx), RTS#, CTS#, VCC (5V) and GND connections. The use of RTS (Request to Send) and CTS (Clear to Send) handshaking depends on the specific implementation and the way you'll use the cable in your project.
Memory mapping in the 8085 microprocessor In the 8085 microprocessor there is 64 kb of memory available of which some are assigned to ROM while others are assigned to RAM. My question is, why is ROM always mapped to a lower region of memory map in the 8085 microprocessor? <Q> When the 8085 starts up, it will start fetching instructions from address zero. <S> It is thus necessary that the memory which is located there contain defined contents. <S> That does not imply, however, that address zero must be mapped permanently to ROM. <S> One could build a system with e.g. 2K of ROM, 64K of RAM, and a floppy drive, and use an I/O bit to control whether memory reads come from ROM or RAM. <S> On startup, have all reads come from ROM (writes go to RAM regardless of the control bit), and have the ROM program copy itself to RAM. <S> Then enable reads from RAM, and load software from the floppy. <S> Since the bottom portion of the address space would be RAM, software loaded from floppy would be able to set up interrupt vectors for its own purposes--something that would not be possible if ROM were still mapped there. <A> The 8085 requires ROM a the lowest memory address because, after a reset, it tries to fetch an instruction from location 0. <S> If there was RAM at that address, the processor would fetch random data and would not start the program. <A> I know this is old, but here, from memory. <S> As I recall, the 8080 and 8085 usually had a hardware circuit that designers used which was made up of a single gate that would remap memory after three clocks signals - just enough to execute a JMP instruction. <S> So the first memory locations at 0:0 came from an EPROM, and the gate would swap the EPROM with RAM on the 4th clock cycle at 0:0. <S> That's from my memory 30 years ago. <S> I would look for startup hardware circuits for 8085 home built computers - I'm guessing it is there. <A> If there was RAM at that time the address,the processor fetch random data and would no stat the program. <S> So ROM not moved other region.
ROM always mapped in lower region of memory map in 8085 microproccesor because after reset it tries to fetch an instruction from location o.
Linear potentiometer for suspension travel I am working on a project for university measuring the extension of a cars suspension. I have a potentiometer available to me, but have a few questions regarding how to use it. I understand that it acts as a simple variable resistor, however, how is the changing resistance used to measure extension? I was told a voltage reading was used in some way to give an extension (unsure of this) but if V=IR, will V not be constant due to battery, and will I not decrease as R increases as it resists the current? I need a way to collect this data and then transmit it 50m and display it. I'm unsure of how to collect the data (and what data I'm collecting, resistance/extension) and transmit it. But I'm thinking of using an Arduino to receive the data and display it on a monitor. <Q> A potentiometer is a variable resistor with three terminals - two are the two ends of the resistance element, and the third is a contact that slides along the resistance element, so the reistance between the sliding contact and either end varies with the slider's position. <S> You would use it something like this: <S> simulate this circuit – <S> Schematic created using CircuitLab <A> Put a voltage across the two outer ends of the device (such as 5V and 0V) and the wiper can be mechanically moved to produce between 0V and 5V on that wiper. <S> Halfway it would give 2.5V. One tenth of the way from the 0V end it would produce 0.5 volts and 9 tenths of the way it would indicate 4.5 volts. <S> That's how a pot works basically. <S> If you can mechanically connect it to the car's suspension then you can interpret the voltage out as some distance but this is mainly down to the mechanical linkages involved. <S> Transmitting it <S> 50m is the hard part especially if you want to maintain accuracy and keep noise out. <S> I suggest you look up wheatstone bridges and see how they do it. <S> Look for 4-wire strain gauge amplifiers to see how they provide power to such devices and use extra wires and an instrumentation amp at the receiving end to produce a relatively clean and error-free voltage. <S> Then feed that signal into your arduino. <S> However, be aware that your arduino's analogue input can only convert to digital with 10-bit resolution i.e. divide your received signal into 1024 bits and that is your resolution. <S> If that is good enough then no problems. <S> If not then you'll need a better ADC such as 12 or 14 bit or maybe higher. <A> this is the circuit you can use <S> What is the maximum resistance of your potentiometer? <S> (in this case it is 10k <S> Ohm what is a god value) <S> if you use this code: <S> / <S> * AnalogReadSerial Reads an analog input on pin 0, prints the result to the serial monitor. <S> Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. <S> This example code is in the public domain. <S> */// <S> the setup routine runs once when you press reset: <S> void setup() { // initialize serial communication at 9600 bits per second: <S> Serial.begin(9600);}// the loop routine runs over and over again forever:void loop() { <S> // read the input on analog pin 0: int sensorValue = <S> analogRead(A0); // print out the value you read: Serial.println(sensorValue); delay(1); // <S> delay in between reads for stability} <S> Source <S> You will get a digital value from 0 to 1023 <S> all you have to do is measuring once the dimension and the corresponding <S> so you know what value reprents which expansiveness. <S> For transmitting the best is to form the analog voltage value into a digital one and send it over CAN or LIN
If it's a potentiometer then there will be usually three electrical connections - two outer connections that would measure a constant resistance between them and a wiper that travels, through mechanical intervention, the length of the resistor.
Power 15 meters of LEDS? I'm trying to make a display out of 2811 LEDs from China (15 meters long x 7 LED strips). Each strip consumes 18W@5V(3.6A) per meter and I plan to use 7 strips, each 15m long. My calculations show we'll need a 5V power supply capable of producing ~460A... (15 meters * 18 watts per meter * 7 strands of LEDs / 0.8 power supply efficiency) ~= 2300W @5V ~>460A. I was planning on purchasing a 600A 5V power supply, running a power bus behind the LEDs and tack it to the strips every 2 meters to ensure even power distribution, but when I tried to calculate necessary wire gauge online, all the calculators say values "out of Bounds" suggesting that the cable needed would be too large. Would I really need to have a separate power bus for each strip? How do we make this work? :-/ We're installing the LEDs between two elevators so it's not like we can hide power supplies in the middle. It would have to be at either end of the 15m runs... Any crazy suggestions would be appreciated. <Q> The typical rule of thumb for these strips is injecting power every 5m or better. <S> Power should be injected at both ends, for the best color matching. <S> FPC, flexible printed copper has relatively high resistance and it quickly adds up. <S> You need 1890W <S> ( (15m * 7 <S> ) * 3.6A ) <S> * 5v . <S> You mentioned the supply's power efficiency at 80%, but that should already be accounted for in it's stated output capacity. <S> On the other hand, a 20% margin of safety, as to not drive the supplies at their maximum output, is a good idea. <S> 2300W <S> it is. <S> You have two options. <S> Get a few 5v high current supplies, and run some cables in parallel to each 4~5m section. <S> Due to the high current, this can get pretty expensive, as each 5m section takes 18 Amps. <S> A quick calculation with a AWG calculator, At a 32 foot run (5 Meters to and from, you have to double the cable run) with 18A at 6V, you get a 0.6V drop... <S> USING 10 AWG . <S> That's 10% wasted in pretty thick and expensive cable. <S> You could go with a 12v supply instead, at 18A, 10M, 20AWG, would result in 50% voltage drop, giving you 6v at the target end. <S> Still not efficient. <S> You only need 90W at the target. <S> At 48V, 90 Watts is a little under 2 amps. <S> 2.5 Amps, to adjust for the cable drop and switcher efficiency. <S> This way you only need some 22AWG cable, resulting in a 2.5% voltage drop, which doesn't effect the switcher at all. <S> You could even run it all in series, as the resistance drop at 22 AWG and 48v can be very negligible with the right switchers. <S> And you only need a 48v 50A (2400W) supply to power it all. <S> Way better than 5v 480A and high gauge cables. <A> You could consider something like copper bar or tubing. <S> The resistivity of Cu \$\rho\$ is \$1.7\times <S> 10^{-8} \Omega \cdot m\$ <S> Recall R = \$\rho <S> \cdot <S> L <S> \over <S> A\$ , so to get a voltage drop of 300mV over 15m <S> you'd need <S> cross-sectional area A= \$ <S> \rho \cdot <S> 600A <S> \cdot <S> 15m\over 0.3V\$ or about \$500mm^2\$. <S> So, a copper bar 6mm x 80mm (about 1/4" <S> x 3") would about do it. <S> Total drop will be double (>0.6V), so you'll still lose more than 10% of your power. <S> It would be nice to find a higher voltage solution. <S> You could consider distributing power at (say) 48V and having local buck regulators along the 15m supplying the low voltage. <S> Or try to find higher voltage LED strips. <A> You haven't selected an answer yet <S> so I'll offer some additional input. <S> I would seriously consider rethinking your architecture. <S> 460A is a tremendous amount of current. <S> Don't do it this way <S> if you want to transmit over more than a few cm otherwise you will need thick bus bars to distribute the electricity or have massive losses in the wire. <S> A standard architecture from the LED industry is to use higher voltage strips e.g 24, 48 or 60V that are driven from a constant current. <S> Then each stip is supplied using a constant current LED supply. <S> Then you can distribute the power to each strip using the mains. <S> This way is more efficient than distributing the power to each strip on the low voltage dc side. <S> If you are adamant about using the 5V LED strips and are willing to tolerate more losses, then I would recommend using a separate 5V supply for each strip. <S> By the way, using a separate power supply for each strip will also improve your system redundancy. <S> If one supply goes down, the rest will still be alive.
The other option, is to get some high voltage, low current supplies (Say 48v), and some small dc-dc buck switchers able to handle 18A output.
Motor Control with PMW or RPM on heavy robot I'm going to try to explain my problem as clearly as I can. I have been building a robot that has four wheels, 2 motors and 2 free wheels. Its a differential drive system. O --- O Motor Wheels| |-o---o- Free Wheels. The objective of this robot is to follow something/someone. I have cameras that give me a 3D point I use to define a position, and based on a setpoint, I correct the Front Error and Side Error with two PID controllers. 1 - Basic calculations to adjust robot are Left Wheel = ( FrontError - SideError ) * Acceleration;Right Wheel = ( FrontError + SideError ) * Acceleration; Side Error and Front Error are results of Two different PIDs. One for each axis of a 3D coordinate space. Front is error on Z ( distance ), Side is error on X ( deviation from center ). Q1: When I test the two PIDs independently, if only testing for front correction, or only side correction, everything works. But when I use the two PIDs I lose control of the robot. Any Idea why? Higher the speed the less control I have. 2 - I am controlling this through software on a computer, and sending those values to a board that controls the motors. What I am sending is PWM values. My problem is: since two motors are never equal, and depending on the load/weight the robot has on top of it, I need different PWM values for EACH wheel, for the robot to go forward. Sometimes, on a scale of 0-1023, if I set 150 PWM to one wheel and 400 to the other wheel, the robot doesn't turn as my calculations predict it would turn and goes straight forward. Leading to my second question. Q2: When dealing with this kind of robots and control. What are the best way to solve this problem? I'm thinking of encoders. Controlling through RPM rather than PWM, and having a PID on each wheel on the motor controller board. Which leads to another issue. Lattency. I have a loop of 175ms. Taking that into account, what's the best solution for me? <Q> Your second problem is probably closely related to the first. <S> When you write the calculation: Left Wheel = <S> ( FrontError - SideError ) <S> * Acceleration <S> what you really mean is: <S> Left Motor Input = <S> ( FrontError - SideError <S> ) * Acceleration <S> If the wheel response is not linear you cannot simply add together two PID outputs and expect to have both work at once. <S> You have two general solutions here -- either develop a model so you can compensate for the difference, or make it so that the wheels actually respond fairly linearly to their input. <S> This second option is probably the best one and it is what you will get if you use encoders and separate well-tuned PID controllers for each wheel. <S> Depending on all the other variables involved, the latency may prevent your control system from being stable . <S> A simple two-pole PID controller might not be able to compensate adequately for it, but if you're experimenting it would be worth a shot, especially if you can fix up your wheel drives. <A> Your design is likely fighting itself. <S> As soon as you enable the second PID controller your transfer function for the first PID is going to change drastically. <S> When just one PID controller is working error leads to a control decision made by that PID controller that is only met with a complacent robot frame that follows along. <S> With a second PID every error leads to both PIDs making independent decisions. <S> They are no longer met with a complacent robot frame, they are either fighting or amplifying each other. <S> All you really need to do in this case is to consider the system as a whole using vectors. <S> The plant transfer function you want to use will take two voltage signals (x_1(t), x_2(t)) and output a position vector p(t). <A> I would formulate the PID controller/s in a different space, for example "heading space" and "velocity space. <S> "So there is one PID controller that "aims" towards the point, and another PID controller that "drives" towards the point. <S> This way, they are orthogonal, and will not fight each other. <S> Additionally, for the robot to move straight when you say straight, you need some form of closed-loop control system. <S> Optical or magnetic encoders on the wheels or on the motor shaft is typically used to make sure the motor runs at the speed you desire. <S> The P part of the PID controllers would be: Delta Heading = <S> (Desired Heading - Current Heading); // plus PID controlDelta Position = <S> (Current Distance - Desired Distance); // plus PID control <S> You then derive the actual output values as: Output Right <S> = Delta Position + Delta <S> Heading;Output Left = <S> Delta Position - Delta Heading <S> ; Heading is the normal right-handed math-based heading, where bigger equals turning left.
If there is a significant difference between the input to the motor and what the wheel actually does, perhaps because there is an unexpected load on the robot, then it is going to be difficult or impossible to tune those FrontError and SideError PID controllers in combination.
Why do some tactile switches have 4 terminals? I am wondering why some tactile switches have 4 terminals instead of two? For example, take a look at these switches , like the image below: (source: pranelectronics.com ) What is the use of the two remaining pins? If the pins of the exact opposite side are always shorted then why don't they have just 2 pins? <Q> I'm going to put David Tweed's comment into an answer, which it deserves. <S> The dual shorted pins allow inexpensive single-sided boards to be used for X-Y matrices of switches without requiring jumpers. <S> Here (from an NKK datasheet ) are a couple examples of such layouts: X-Y matrix <S> (This would typically be scanned by a microcontroller or ASIC): <S> Common line (one side of each switch common, typically it might be connected to Vss or Vdd and a pullup or pulldown resistor (perhaps internal to a chip) <S> would be required for each switch. <A> Mechanical stability. <S> The shorted pins makes the pinout slightly more versatile when routing a PCB. <A> Think of a switch as being two staples (held in place by the plastic base) and something that can bridge between them. <S> Such a design requires two non-moving pieces of metal plus a moving contact which doesn't have to flex much and a coil spring to keep that contact away from the pins. <S> Such a design is more mechanically robust than using a flexible contact which is integral with one of the pins. <S> Further, if one needs at least three solder connections on the board for mechanical stability, it's easier to use two identical "U"-shaped <S> pieces of metal than it would be to have contacts which were only connected to one pin, and then need other pieces of metal for the other mechanical connections. <A> My guess is that 4 pins are for mechanical stability. <S> Then since they are there anyway, someone in marketing had the brilliant idea to feature them as jumpers too. <S> Think about it though, If you only had two pins there would be less of a need for a jumper. <A> Other responses are very detailed and accurate, but there is a much simpler and more to-the-point answer... <S> The reference images you provided not only have different numbers of pins, but also differently shaped ones. <S> Four pin switches are commonly used on breadboards and have kinks in the pins for that purpose. <S> Two pin switches, or any other number with straight pins, are intended for soldering to a PCB (printed circuit board).
When introducing 2 extra pins for mechanical stability is probably cheaper (and more rugged) to build shorted pins than to add unconnected pins. When soldered down with four leads the part is can't move in any direction.
Can anyone tell me any exclusive application of Johnson counter? I went through many types of counter in my digital electronics text book. Each one was interesting. When I came across Johnson counter, I was not able to figure out any practical application. Can anyone help me for the same? <Q> Here is one example of this. <A> If you are making a decimal counter and decoding it, a Johnson counter uses 5 rather than four flip-flops, but can be decoded to 10 outputs with only 2-input gates for a net saving in CMOS technology. <S> Below is an example from the CD4017 datasheet . <A> You can use it to make a sign that has a ring of lights that move in a never-ending circle around it. <S> Tie one group to the right button and the other group to the left button and this simulates the pushing of the left and right buttons alternatingly (with a very brief, but necessary, space in-between) to make the characters run extra fast. <S> Imagine the hours of joy you'll have as you sit at your home arcade, alone, going round after round of defeating the computer again and again. <S> Sure beats being married. <A> A Johnson counter can be used to divide a clock by \$2n\$. <S> So in contrast to chain of T-FF - which generate a by \$2^n\$ divided clock - a Johnson counter can divide by every even number. <S> If you change the counters init value, it's also possible to configue other duty cycles then 50:50.
If you attach suitably-valued resistors to the outputs of a Johnson counter, you can synthesize some very high-quality sinewaves. I had a project where I used it to cheat in the old 80's arcade game, Track n' Field, by OR-gating two adjacent groups of three outputs (spaced by two others, totaling the 10 total outputs).
Open and Short Circuit questions I am confused on the terms Open, Short, and Closed when talking about circuits. As far as I know: a) Open circuit means the wires are cut off so there will be no current flow, but there is voltage. b) Closed circuit means the wires are connected so there will be flow of current, but there is no voltage c) Short circuit also refers closed circuit. Is my knowledge (a,b,c) about the question correct? There is also another thing which confuses me: d) Voltage is the force that makes the current flow. How can there be current but no voltage or voltage but no current? (from formula: \$V = I \cdot R\$) Please explain a, b, c and d so it won't bother me anymore if I am going to solve circuits.. <Q> For (a,b,c) that's more or less correct. <S> Another way to re-word these two terms is that a short circuit has 0 resistance (R=0), and an open circuit has infinite resistance (R=infinity). <S> So in Ohm's law, \$V = IR\$. <S> If \$R = 0\$, then \$V = 0\$. <S> If \$R = \infty\$, then using some mathematical trickery: $$I = <S> \lim_{R\rightarrow \infty} \frac{V}{R} = <S> 0$$ <S> As far as the force analogy goes, if it's useful think about you pushing on a building. <S> Just because you are applying a force doesn't mean the building is going anywhere. <S> These type of analogies tend to break down when dealing with theoretical 0's and infinities, so I wouldn't rely too heavily on them but rather look at the mathematics. <A> simulate this circuit – Schematic created using CircuitLab <A> I may be wrong since I did not study this in English, but I see a major difference between b) and c).From a very practical point of view, a closed circuit is good, a short circuit is very bad ! <S> A short circuit is, for instance, connecting a wire directly between the poles of a battery or power supply. <S> Whereas a closed circuit is just a "normal" load between the poles. <S> Oops (let me be careful here, I don't want to get sued or anything), don't actually, physically, do it at home (or anywhere else), the wire might melt, you might burn yourself, start a fire, cause the world to stop revolving, etc... From \$V = <S> RI\$ : <S> in theory, for short circuit R=0 (this is never actually the case unless you got superconductors) so that I becomes "infinite". <S> Actually again, your battery will deliver its max current, heat up and die quickly, your PSU will either do that also or shut its output down if sanely designed. <S> Regarding d) <S> , once again, this is the theory: as mentioned above, a wire does have a resistance <S> so there is some voltage (potential) difference when current runs through it. <S> Similarly, there can be leak currents that contradict the "voltage but no current flow". <S> I learned with hydraulics analogies, it was rather evocative, but that's a little too long to elaborate about here. <A> You are right about open circuit, the wires are disconnected. <S> In case of short circuit as well as closed circuit, the wires ARE connected but the difference is that in case of short circuit, the resistance between the connection is extremely low so very high current flows as per ohm's law, whereas in case of close circuit, the connection offers considerable resistance, hence no high current issue. <A> There are a few misconceptions in your question, and it might help you understand things if we clear those up. <S> For a) and b), replace "there is" with "there may be". <S> The way you have defined an "open circuit" means that there is effectively an open circuit between any two points in a circuit that are not connected together by an ideal wire. <S> When there is not an ideal wire connecting two points in a circuit then it's possible that those two points will have a different voltage. <S> So, removing and ideal wire from a circuit means that it becomes possible for the voltages at those two points to differ. <S> Your definition of a "closed circuit" is any two points connected by an ideal wire. <S> By the definition of an ideal wire the voltage at those two points must be the same (the voltage difference must be zero). <S> Current might flow through the wire, depending on where you connected it in the circuit. <S> For circuit analysis, it can be helpful to use a zero-ampere current source to represent an open circuit and a zero-volt voltage source to replace a short circuit. <S> The reason that Ohm's law doesn't apply here is that the closed circuit is created using an ideal wire, and Ohm's law only applies to resistors. <S> The ideal wire, by definition, has no resistance. <S> When considering these circuit analysis concepts it's important to remember that we're talking about ideal circuit elements rather than real circuit elements. <A> A short is a current path with no resistance. <S> All that is determined by what you are measuring across. <S> The reason why you can read current and voltage across a battery is because batteries have internal resistance. <S> Battery by itself is open. <S> When you put your leads on battery, you complete or close the circuit. <S> Shorts bypass the load straight to ground but is not a complete circuit, like circuit was shorted, you owe him some load. <S> You give him the load and make it even, so the deals is now Closed. <S> Closed circuit is when everything is connected in the path to ground or reference. <S> An open is when there is NO current flow. <S> You can have a voltage reading across an open but there is no current because there is no physical path. <S> Best advice is to take a PSPiCE class. <S> There you learn to plot a circuit using coordinates.
In general, there doesn't have to be a voltage/current just because there is a short/open, there just can't be any voltage in a perfect short and there can't be any current in a perfect open.
Do digital Anti Aliasing filters exist for traditional ADCs? I'm currently learning about Analogue to Digital Converters. From what I understand, aliasing occurs if the input signal being sampled has power above the "Nyquist frequency" of the ADC( Sampling frequency of the ADC/2 ). So, then logically, I assume then that all the anti aliasing filters have to be analogue. Or the same problem of aliasing due to sampling would exist, no? Either that of the digital anti aliasing filter has to sample at very high frequencies? Not to mention, have an DAC in the filter module to put the signal back into the analogue domain. Which would ask the question, why wouldn't we then simply just use a high frequency digital sampler and then have digital filtering done afterwards. I'm asking because most of the tutorials and lectures I come across seem to miss how the signal is actually filtered before the sampling. Rather they just simply say the type and order, e.g. Butterworth 4th order. But no mention of how this would be implemented. Where usually do people put these filters?. On the IC for the ADC itself? Or as an external filter before the sampling stage. Are physically big filters (e.g. through hole capacitors, inductors and resistors) the norm? Or rather integrated filters? For example, I'm guessing the ATMEGA328 (used on Arduino UNO) has an integrated anti aliasing filter since we usually don't filter the signal. Particularly, I am referring to audio band ADCs , especially regarding the types of the filters. But the rest of the question, I am asking in a general sense. <Q> Do digital <S> Anti Aliasing filters exist for traditional ADCs? <S> Not in the sense you are discussing. <S> There are other forms of "aliasing", but you seem to be considering only analog to digital conversion. <S> If the signal is already digital (so that you can filter it digitally), then it's already been aliased. <S> It's too late. <S> Where usually do people put these filters?. <S> On the IC for the ADC itself? <S> I'm sure you can find ADCs with integrated filters, but it's not the norm. <S> Different designs have different filtering requirements. <S> You may need a linear phase filter, or you may not. <S> You may need very good performance, or you may need very low cost. <S> You might not even need filtering at all, if you know what frequencies your analog signal can contain. <S> Are physically big filters (e.g. through hole capacitors, inductors and resistors) the norm? <S> Not really, for reasons of cost. <S> You need bigger components if you need to handle more power. <S> High power is not usually something you need to drive an ADC. <S> It may also be that a particular design requires a high capacitance or high inductance that's attainable only through large components, but a good engineer will avoid it if possible. <S> Much better to use a 2 cent SMT capacitor, than a 20 cent through-hole electrolytic, wherever possible. <A> ADCs <S> All the ADC anti aliasing filters that I'm aware of are analogue i.e. they filter the analogue signal before it is sampled. <S> Because an ADC can have its conversion rate usually controllable from nearly DC to S\$_{MAX}\$ <S> it doesn't make sense to have the filter built in to the device <S> but I wouldn't preclude this happening on some devices. <S> Decimation <S> - aliasing can occur here just as it can on an ADC - for instance, you can't just throw away every other sample and hope to achieve digital sample decimation - you need to filter the signal to take account of the decimated sample rate, then throw samples away. <S> Typically, you add two samples together and divide by two - this gets rid of out of band signals at the new lower rate. <S> Everyone's done it or recognizes the idea. <S> DACs <S> To broaden my answer <S> I thought I'd mention a filter required to linearize a DAC output. <S> If you sample a sinewave at close to the maximum frequency (before hitting aliasing problems) then reconstructed the analogue value with a DAC, you would not get the same amplitude signal as the original analogue - this is because most (maybe all) tend to attenuate the signal output at the expence of producing a larger RMS content of out-of band sampling noise. <S> In your minds eye, a low frequency signal that is quantized at a high rate will look pretty similar to the original input to the ADC - it'll have a small mushy element due to quantization <S> but, as the input frequency approaches maximum, the "mushy" parts get bigger and bigger <S> whilst the actual analogue value produced gets smaller and smaller and for this reason it's sometimes necessary to use an anti-sinc filter. <S> Maxim's application note 3853 offers a decent explanation. <A> Yes, many \$ \Delta \Sigma\$ converters have digital FIR anti-aliasing (and decimation) filters. <S> That's possible because of the architecture- they're actually oversampling and decimating down to the output sample rate. <S> The advantage of a digital anti-aliasing filter is that it can easily be a high-order filter with a sharp cutoff frequency that is almost at the Nyquist rate of \$0.5\cdot F_S\$. <S> (See link below for above figure, Joe H.) <S> You still may need an analog (analogue) anti-aliasing filter ahead of the oversampling converter if there is any signal or noise content up there, but the demands on it are significantly relaxed. <S> See, for example, the ADS1278 which is 64x or 128x oversampling. <A> The input to a digital filter will necessarily be something that's sampled at a certain rate. <S> For the filter to do anything useful, that rate must be more than twice the desired cut-off frequency. <S> Most analog-to-digital converters are designed to perform conversions at the desired output sample rate, and output sample rates are often chosen to be more than 2x the highest frequency of interest, but not by a huge amount. <S> That somewhat limits the usefulness of digital filtering in many cases. <S> Some audio CODECs, however, do include digital filtering. <S> I'm not sure exactly how everything is implemented internally, but one chip I've used was designed so that when used with an 8KHz sampling rate, it would apply a filter with a sharp cut-off at 3.5Khz, but signals above 5.5Khz would alias back to the baseband. <S> That design allowed some slight simplification in the analog front-end; since it meant the analog pass band could extend up to 4.5Khz, rather than only up to 4KHz, giving the front-end an extra 500Hz to play with. <S> Conceptually, it shouldn't be difficult for an audio-frequency ADC to oversample internally so as to allow the analog pass-band to extend up another octave or two, and I think I've seen CODEC chips which do that, but I'm not familiar with them. <S> It's worth noting that many delta-sigma converters have an inherent sampling rate which is much faster than their output sample rate, but produces samples with a lot of noise; the output of such converters is then digitally filtered to yield a digital audio stream at a much lower sample rate. <S> I think that's how most cheap PC sound chips work, but I don't know the details.
There are digital anti-aliasing filters and these are used (exclusively in the digital realm) to convert from a particular sample rate to a lower sample rate
Non-linear error in ADC readings I am measuring voltages up to 20V with my ATmega2650 MCU (10-bit ADC). I'm using 5V precision voltage reference (LT1021 - 0.05%). Voltage dividers are setup with 1% Panasonic resistors. Vcc->10kOhm->Measure->3.3kkOhm->GND. Division ratio: 3.3/13.3=0.248 What I've noticed is the following increasing errors while measuring bigger voltages: Vmeas ADC Err(%)3.05 152 -0.0133829294.09 205 -0.00759685.02 253 -0.0020756956.08 308 0.0030573057.07 359 0.00541418.07 410 0.005952799.07 461 0.0063722910.02 510 0.00776423211.05 563 0.00877735312.05 615 0.0104693213.05 665 0.00892573514.05 717 0.01036624215.06 769 0.01095519816.05 820 0.01149580417.07 872 0.01136867118.06 923 0.01182610319.04 973 0.01173950219.51 998 0.0127115419.94 1020 0.012715509 Can someone explain what is causing such non-linearity? Any hints on math to estimate this (ADC features rather than poly-fit)?Any references to mathematical models would help. EDIT - errors through all voltage range: The calculation methodology: #define PSU_ANALOG_CHANNELS 3#define PSU_ANALOG_MEASURES 5#define PSU_ANALOG_MEASURE_DELAY 1//apply vRef to each pin to measure post-divided ADC readingconst int psu_adc_corr[PSU_ANALOG_CHANNELS] = {250,251,251};int psu_volts_raw[PSU_ANALOG_CHANNELS];//stores ADC readingsfloat psu_volts[PSU_ANALOG_CHANNELS] = {0}; //stores final valuesfloat mvAdc[PSU_ANALOG_CHANNELS]; //stores mV per each ADC-channel (to avoid division)void calcMvADC(){ for (int i=0; i<PSU_ANALOG_CHANNELS; i++) { mvAdc[i] = 5.0 / psu_adc_corr[i]; }}//returns averaged reading for each ADC channelint readAnalog(int ch) { int val = 0; for (int i=0; i<PSU_ANALOG_MEASURES; i++) { val += analogRead(ch); delay(PSU_ANALOG_MEASURE_DELAY); } return val/PSU_ANALOG_MEASURES;}void readADC() { for (int i=0; i<PSU_ANALOG_CHANNELS; i++) { psu_volts_raw[i]=readAnalog(i); }}/*>6 <=7 : -1.1%>7 <=9: -1.14%>9 <=13: -1.25%>13 -1.7%:*/float corrVoltage(float V) { if (V<6) return V; if (V>6 && V<=7) return V*0.989; if (V>7 && V<=9) return V*0.9886; if (V>9 && V<=13) return V*0.9875; if (V>13) return V*0.983; return V;}void calcVoltages() { for (int i=0; i<PSU_ANALOG_CHANNELS; i++) { psu_volts[i] = psu_volts_raw[i] * mvAdc[i]; psu_volts[i] = corrVoltage(psu_volts[i]); }}void setup (){ analogReference(EXTERNAL); calcMvADC(); Serial.begin(115200);}void loop (){ readADC(); calcVoltages(); for (int i=0; i<PSU_ANALOG_CHANNELS; i++) { Serial.println(psu_volts[i]); } delay(500);} <Q> ADCs are naturally non-linear. <S> Roughly the transfer function starts at 0, then increases faster than the expected linear transfer function until it reaches #bits/2 and then curves back to where it should be. <S> I can draw a diagram if this explanation is not clear. <S> The main problem is that you are assuming the converter has the linear transfer function with Voltage = 5V/250*(value from ADC). <S> It does not and the error isn't even linear, as you've already observed. <S> Given the shape of the real transfer function, the data provided by Andy, and the way you are computing the errors at higher voltages the pattern you are seeing is as expected. <S> This is because the slope (5V/250) is near the maximal of the slope of the real transfer function. <S> Edited to add: Maybe it was clear from your post they are being overestimated since Err % is always > 1. <S> It is clear if Err%=(ATMega reading)/(real value) <S> 2nd edit: Actually, what you can do easily and see how the results change: <S> Put 20V across the voltage divider. <S> You will get a number say $N$ then define psu_adc_corr= <S> N and myAdc = <S> 20 <S> / <S> psu_adc_corr=20/N. <S> I would be interested to see what you get. <A> here's probably the best explanation <S> I've found from the vendor <S> It has a section dedicated to non-linearity with the following conclusion: " Non-linearity cannot be compensated for with simple calculations. <S> Polynomial approximations or table lookups can be used for that purpose. " <S> So I've made int8_t array of 14 ADC error values (that accounts for 1 volt increments). <S> I've applied those corrections on ADC reading and yay! <S> - I do now have the voltage readings with an error of 0 to 1mV. Furthemore <S> , I can now use single value of mV_per_ADC_step (in respect to my previous version for which I've had dedicated mV value for each ADC channel). <A> I'm not that familiar with the Atmel ADC converter, but I suggest that maybe the acquisition time for the S&H is not long enough. <S> I think it should be 15usec or greater. <S> The maximum time constant is 100K\$\Omega\cdot 14\$pF or 1.4usec, so 10 time constants is about 15usec. <S> Alternately, do you have something like a 5.1V Zener diode on the input? <S> That could easily cause errors in that range. <A> The ADC in the MCU is specified as having an absolute accuracy of up to 2.5 LSbs at a sampling rate of 200kHz. <S> This is specified at aVref and Vcc voltage of 4V <S> but I'm assuming it's going to be very similar at 5V. <S> If your reference is 5V, 2.5 LSbs is about 12mV. <S> This can manifest itself positively or negatively for a particular input voltage. <S> I'm not sure how your values are obtained but at 0.248 <S> *7V on an input, 12 mV can be an error of 0.69% which is somewhere in the realm that your are seeing. <S> But if you are using a differential ADC channel this can increase to about 18 LSbs at a gain of unity because there is an internal amplifier adding an error.
I don't think you stated, but let me make a conjecture based on this analysis: Your ADC consistently overestimates the voltages.
Does driving an microcontroller's GPIO when it is powered off weaken the chip? We are using the LTC5800-IPM microcontroller in a project. The way our design is now, the IC's GPIO pins will sometimes be driven high (to 3.3V) or low when it is powered-off. Will this weaken the chip? The absolute maximum ratings state the voltage on any digital I/O pin is -0.3V to VSupply+0.3V. If the answer is no, could the IC be weakened during power up? The LTC5800-IPM does not have the most detailed datasheet. If it is not clear for that device in particular, I'd be interested to know for CMOS microcontroller GPIOs in general. <Q> Unless the datasheet and associated documentation specify otherwise, do not apply a non-ground voltage to an unpowered device. <S> The device may become powered through the input protection diodes on the pin and could behave erratically. <S> If there is no way to modify the schematic such that unpowered devices do not have voltage applied to their inputs then use tri-state buffers such as the 74HC125 or 74HC244 to hi-Z the inputs when power is not applied to the device. <A> As you read from the datasheet , the absolute maximum input voltage is Vsupply -0.3. <S> So if Vsupply is 0, you should not apply more than +/- <S> 300mV to any input. <S> As well as possible damage to the particular I/ <S> O pin's protection network, if you apply power when there is an input being driven from a low impedance source, it can cause latchup , which will either short the power supply to a low voltage or destroy the chip (maybe both). <S> To isolate the two devices, you could use a voltage translator such as the 74AVC1T45 , which goes high impedance if either Vdd is 0. <S> The protection network is something like a small diode between the input and Vsupply (and something similar to GND) and usually some series resistance, either of which can be damaged if you drive too much current through the input. <S> If you drive the input to (say) 3.3V, current will flow out of the Vsupply pin and into whatever else is connected externally. <S> At a minimum this is a big load on whatever is driving the chip even if it does not immediately cause damage. <S> Latchup (as described in detail in the link above) is an effect caused by the parasitic SCR structure inherent in most CMOS ICs. <S> If a low-power chip is getting very hot to the touch, it's probably latchup. <A> I'm going to use CMOS IC CD4066 for similar situation. <S> It has wide supply and input/output voltage range and four bi-directional switches. <S> The voltage between two systems should be equal, thus not violating the maximum permissible voltage for the GPIO inputs compared to Vdd. <S> The frequency of the communication protocol must be taken into account. <S> Georgi Motev
Yes, it's possible to damage the chip by driving it from a low impedance source when Vdd is 0.
Laser diode to remove copper layer from PCB I used a DIY kit and made a PCB milling machine. So far I am happy with it but it is slow and the minimum thickness of the lines is depends on the tip's size. I want to replace the cutting bit with laser diode to ablate copper layer directly to ablate acid resistant paint so I would overcome the issues I mentioned. EDIT: As Spehro Pefhany explained removing copper layer with laser requires much powerful laser than a simple laser diode. At this point using a laser diode to ablate paint would be a better way to do this. Here are my questions: What type of laser diode I need to use to remove ~1 mm thick paint layer? How can I calculate the minimum power I need to ablate the paint layer? I read about laser diodes, driver circuits, protections (diode itself and human body) but I could not find a decent source about my questions. <Q> An ordinary laser diode won't cut it (literally). <S> You need something like a Q-switched laser, pulsed at 10's of kHz. <S> The peak power has to be extremely high to ablate copper (>2500°C), and some nasty fumes come off the epoxy substrate, which have to be exhausted. <S> Even a 40W \$CO_2\$ CW laser won't cut thin metal foil- <S> it just bounces off. <S> Here 's a commercial unit (costs as much as a really nice automobile). <S> Class 4 lasers are not toys! <A> I used a 808nm 0.5W laser diode and it can remove paint from over the copper layer. <S> I have explained it in the posts of my blog, from buying to the current results. <S> The URL is: http://gabuleu.blogspot.fr <A> Others are ahead of you on this project: http://www.diyouware.com/ <S> DiyouPCB is a PCB printer which uses a Blu-Ray™ pickup <S> They are getting some very good results, notably they are still using a photo-resist process and not etching the copper off directly with the laser. <A> What about this prototype ? <S> https://www.youtube.com/watch?v=4SNkzoOvoD8 <S> (1st version) <S> https://www.youtube.com/watch?v=uIIwU29H3E8 (2d version) <S> It answers exactly to the original question and is home made with some recovery equipment <S> and it seems that it removes copper perfectly and fast. <S> It would be quite nice to reproduce this printer and make it open source... <S> If someone has an idea (and time)...
If you really want to fool around with this sort of thing, you can find suitable lasers on the surplus market, but it's not going to be a matter of attaching a little diode to an engraver head.
Analog Design to VLSI Layout Tool/Software I want to implement an 555 timer. I am looking for tools preferably FREE ones. I looked at certain tools which have GUI where I can select and drop transistors which I find tedious. Is there any language which I can use to describe transistors , something like a analog counterpart of VHDL/Verilog. Also the language /tool used should give me the VLSI layout. <Q> There are many, but use Magic, it integrates into lots of OSS tolls Spice etc. <S> http://opencircuitdesign.com/magic/ <A> Open-source high performance timing analysis tool eSim – Complex Circuit design, SPICE simulation, analysis and PCB design Qflow – Tool chain (like Yosys, Graywolf) for complete RTL2GDS flow <S> The above tools were recommended by Kunal Ghosh. <A> I guess there are two parts of the question/answer: 1) For an analog replacement to VHDL/Verilog there are e.g. spice and Verilog-A/Verilog-AMS. <S> The seemingly best/most popular open source spice realization is Ngspice . <S> For Verilog-A/Verilog-AMS there seems to be no open source tools. <S> 2) <S> Analog place-and-route is not as mature as its digital counterpart. <S> Still, much of the final performance is at the hands of experienced designers. <S> Hence, I doubt there will be any free tools for this (I couldn't find any at least) <S> and there are hardly any commercial ones either, at least not really good ones.
There are many open source tools available now , Ngspice – General purpose circuit simulation program for non-linear and linear analyses Magic – VLSI Layout editor, extraction and DRC tool Opentimer –
Convert a PWM to analogue with double the voltage range? I have a PWM output (0-5v) that I need to convert to an analogue voltage. Simple = RC filter. However, the voltage range from that analogue voltage needs to be twice that of the input voltage, and I'm just not sure of the best approach. Basically: 5v PWM to 10v analogue A colleague suggested to use a voltage doubler (such as 7660) to power an op-amp, configured with a gain of 2. Any other suggestions would be greatly appreciated. Thanks <Q> A voltage doubler won't be effective especially if the PWM duty cycle 30% or less - the 7660 needs at least 1.5V to power it <S> and that is the first problem. <S> The second problem would be finding an op-amp with perfect rail-to-rail outputs. <S> Again a problem made worse at low voltages. <S> The only solution I can think of is to provide a 10.5V supply to a rail-to-rail op-amp with a gain of +2. <A> Filter the PWM with a suitable LPF. <S> Use a DC-DC converter to get +12V or + 15V from the 5V rail. <S> Done. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> Something close to yours friend solution, use small boost SMPS with MC34063 (cheap&good) to convert 5V to 12V and power OP-amp with the gain of 2, same effort way better results. <S> For OP-amp you can use LM358 single supply rail to rail cheap and decent if you do need some higher precision <S> (then OPA2180 is good with lower offset)Also <S> you can put little bit integration cap in the feedback to additionally suppress PWM noise. <A> A six-pin or eight-pin microcontroller that reads the PWM input cycle, and outputs to, for example, an I2C potentiometer or DAC, or uses a built-in DAC, would be a lot simpler than shown here. <S> The suggested circuit can be realized with an AtTiny85, and has an output bandwidth of about 160 Hz. <S> The input precision is in the sub-microsecond range. <S> All the software has to do is read the width of input pulses, and set the duty cycle of the output PWM (inverted.) <S> simulate this circuit – <S> Schematic created using CircuitLab
Use a gain of two single-supply amplifier powered from the 12V rail to double the voltage input. Apart from anything else the 7660 converts its input to a negative voltage and that is of little use here. You can even output a high-frequency PWM to a RC filter through a MOSFET if you want your own "ghetto" DAC.
Should I Remove the Power When Unplugging Components From an Arduino? When I am done with a circuit and want to build another, should I remove power from the Arduino or can I just remove the unnecessary parts and start plugging in the necessary parts? <Q> While disconnecting and re-connecting things, you may introduce short circuits, or put the circuit in undesirable states (eg disconnecting power to a chip while leaving power on its I/O pins, thus powering the chip throough protection diodes.) <A> If you do not remove power during changing your circuit elements on the Arduino, you might have risk of putting a positive in a negative and negative in a positive, or do other type issues: Short Ciruiting Over Powering the Arduino board from a wrong Vcc power source Causing a circuit to go hay ware if connected incorrectly (i.e. putting a an led without a resistor while arduino is supplying power to the LED circuit). <S> All these problems are avoided - <S> If you power off Arduino during re-aranging your Arduino microcontroller board. <A> I have been told it is best to remove the power. <S> I, however, have not removed the power a numerous amount of times, rewired the circuit and my Arduino is still fine. <S> Some issues that might occur when not removing the power: short circuits possibly frying the Arduino, components not receiving the correct signal, and components not sending the correct signals. <S> In short, it is best to remove the power when changing the circuit.
It is best to remove power while re-wiring a circuit, so, yes, disconnect the USB cable, and any other sources of power.
Determining maximum current through 18 gauge wire in robot arm For a robotics application, I'd like to power some external electronics and sensors off the logic circuit in a robot arm. The components are a computer (19V, 65W => 5A), 2 cameras (1.2A), 1 light (0.35A), USB2.0 I/O board, and power board. All this on top of current draw from the motor logic, which runs off a 4.3A power supply atm. Therefore, I estimate the upper bound to be 12A. The logic power runs through an 18 gauge wire. According to this table , 18 gauge permits either 16A as chassis wiring, or 2.3A as power transmission. Note the robot arm is roughly 0.6m long; obviously, because the logic power runs internally, the wire length is greater than 0.6m. Will I be able to power my electronics from logic power? I am willing to test my system empirically. (BTW, as a CS major, I have zero experience with electronics.) <Q> Three things of note: <S> The Maximum Amps for Chassis Wiring is also a conservative rating, <S> The AWG guidelines are very CYA. <S> It says 16A, but that's probably anywhere from 60% to 90% of what it can actually handle. <S> but is meant for wiring in air, and not in a bundle. <S> Multiple 18 gauge wires tied together will have a lower (derated) capacity than a single 18 gauge wire. <S> And in a pipe less than in free air. <S> But the biggest thing is really your application ! <S> Length is minimal, probably 1 meter (plus return path, so 2 meters), so the wire resistance is minimal, which means very little voltage droop. <S> But how many power wires are there? <S> Is each motor individually cabled? <S> Is the full amperage running the full length of the cables? <S> Is the 5 Amps for the computer actually going over the arm, or is it at the base? <S> Can it be individually powered? <S> What duty cycle is to be expected? <S> How often are the motors going to be on? <S> How long will the entire setup be on? <S> For the most part, you need a wiring schematic. <S> A plan on how everything is connected. <S> Without that, you cannot really know what you need in terms of wire size. <A> Though the 18AWG copper wire can support upto 16A, there are certain derating factors which you need to consider while calculating its ampacity. <S> One factor is the ambient temperature. <S> The current carrying capacity of copper changes with temperature and hence some margin needs to be added to your design to accomodate for those losses. <S> This arises from the fact that the current passing through the wire also generates some heat which gets dissipated in the conductors. <S> Further details about the derating factors and how to apply them to your design can be found here Now coming to the specific problem which you mentioned here, the worst case maximum power which you have calculated for the system is ~12A. <S> Then you can decide on either of the two choices - Increase <S> the number of 18AWG wires to increase the current capacity Change the wire gauge to a better value (16AWG or so). <A> If a lot of the load is the motors, and they have a short duty cycle, you can take a much bigger load than the book says - <S> the table you are reading is probably a worst-case value. <S> Or if the conductor is exposed and the machine is in the Arctic you can use more power than if it is in Dubai. <S> However, it is generally a very bad idea to push electrical equipment to its limits. <S> Databases do not start fires when overloaded, power supplies do. <S> And a robot arm is rather likely to be overloaded at some point.
Whereas an 18AWG wire can support upto a maximum of 16A. After you apply the derating factors (which is applicable to your scenario) in the calculation, you may find that the ampacity of the wire is not enough for your design. For short lengths of wire, such as is used in battery packs you should trade off the resistance and load with size, weight, and flexibility. Another factor which you need to consider is the number of wires you are using to carry the required amount of current. Current capacity of a conductor is basically a question of heat management. A schematic for the robot arm would be the best place to start.
Advice Needed On Removing Stubborn Circuit I'm new to soldering and I've done some research on what I need in terms of material and tools and what I need to do in terms of removing and replacing a circuit. The circuit I'm replacing is a Laptop (ASUS g53sw) power jack. This component has 5 connections onto the circuit board and while I've been able to remove a good bit of the existing solder with a wick and flux I'm finding this component is still stubbornly stuck to the board. I'm in need of some good advice on how to remove this as I want to avoid damaging the system. I've read a number of articles and watched some good videos but I still need some pointers as I don't doubt a professional could handle this. <Q> Add more solder. <S> Use tin-lead solder or special low-temperature solder (ChipQuik). <S> The solder is easy to clean up with braid afterwards. <A> If you've already removed some of the solder, but find the pin is still stuck in the hole. <S> and then I use a solder sucker instead of a braid. <S> Also, you might check for any kind of glue under the part. <S> Circuit parts that are physically large or are subjected to external forces (like plugs for external cables) are commonly attached to the board by other means: like screwed down or glued down. <S> That way the forces are not held by the soldered circuit pins themselves. <A> Usually, there is one pin that is making it hard to remove. <S> That is usually the ground pin, and it will be attached to the ground plane. <S> The ground plane will try to suck away the heat as fast as you can apply it. <S> This is where you need a high wattage iron, so you can get it hot quickly. <S> On a good day, you can remove the solder, then wiggle each pin until it breaks loose. <S> Again, usually all except the one difficult one. <S> Then you know which one to work on. <S> Failing all that, there is plan "B". <S> Destroy the connector--crush it, for example--and once all the plastic is gone, each metal contact can be dealt with on its own, instead of having a 5-piece puzzle. <A> Multi-layer boards and huge ground planes are your enemies. <S> Your friends are a powerful iron and this strategy: crush, melt, or otherwise break the connector so you can extract each pin individually (if all pins are on the perimeter, preferably snip them free of the plastic body) <S> heat the pin , not the pad, <S> just enough so it can be wiggled free with a small tool (like tweezers) <S> quickly work the pin loose ( <S> before the heat in the pin is drawn away through either the tweezers or the board) <S> clean up the aftermath thoroughly, because it will be ugly
What I've found helps is adding a little extra solder back onto the pin to make sure you get a nice reflow up through the hole If you can make a solder blob over all five pins you can just lift the jack out.
How to find info on part efficiently? I'm not exactly a novice to electronics, but my problem is closely related, and I still feel like a complete newbie at those times. I have no problem sourcing parts for new projects. Part of that is knowing a suppliers stock, and if my favorite two or three don't have them, I'll look to my semi-favorite suppliers. Usually, they have datasheets for their devices linked right in their web shops, so finding datasheets for those parts is no problem at all. However, when trying to identify components (especially on older devices), I feel like running against walls. Here's an example: I found a socketed IC with the label "IAM E3318" in a standard DIP package. I have no idea what this thing is, let alone found a datasheet for it. All I can deduce, is the manufacturer's short name is "IAM", and the part number is E3318. However, this happens to me on many devices, especially older ones. Is there any standard method of seeking info about obscure parts like this, other than googling for hours?Some datasheet aggregaters like Alldatasheet, sometimes give a positive result, only to link me to a completely other, unrelated part. Other times, I get a seemingly positive result, when clicking on the PDF symbol: "DATASHEET NOT AVAILABLE". This goes on and on, and is furiously frustrating. What should I do? How should I go about looking for datasheets? <Q> I searched for "IAM E3318" with quotes to look for the exact phrase. <S> The third result (this post being the first) was http://www.computerhistory.org/collections/catalog/102711348 <S> Unfortunately it didn't help with a part number, but the manufacturer states Intel Corporation. <S> Exactly how much this can be trusted, I cannot say, but it might give you more information to refine your search. <S> You could also try and add things like 16 (number of pins) or DIP <S> (if you know the package). <S> Alternatively you can search for the 'main part' ie a motherboard, or whatever the assembly where you're mystery component is on. <S> You never know, you might find a BOM or schematic. <S> (try searching for that part number but only for PDFs e.g. 'NE555 filetype:pdf') <S> Hope that helps <A> Well, don't beat yourself up. <S> Technology evolves very fast and older devices fall out of use very easily. <S> Google is your best hope. <S> If you don't find something easily here, you should look for newer alternatives. <S> That said here are a few resources that you can try: <S> www.datasheets.com <S> www.alldatasheet.com <S> www.datasheetcatalog.com <S> www.datasheets360.com/‎ <A> Here's a site that I've used before (warning: it's a Russian site, so be careful) <S> http://www.systek.ru/marking.php <S> You can enter component markings and then sort by package. <S> It's helped me understand a few mysterious SOT-3 components. <S> Also, this site is useful for help identifying the manufacturer of a part: http://how-to.wikia.com/wiki/Guide_to_IC_manufacturer_logos
One thing you could try is to attempt an advanced Google search.
How in CDMA mobiles receiver gets unique code to decode its respective signal? Transmitted data in CDMA mobile is encoded with a random code. Receiver requires this random code to decode data from the received signal. From where the receiver will get this random code? <Q> The code is statistically random but it is not secret. <S> In fact, it's chosen to not conflict with another code on the same frequency. <S> Both ends know the code <S> --it's part of the notion of "channel number". <S> This code sequence stuff is common and you will find the same thing in GPS, and even modems. <S> Sometimes it is called "scrambling". <A> The unique code is not truly random, it is a psuedorandom bit sequence generated by a linear-feedback shift register (LFSR) or something similar. <S> The method of generating the code is predetermined and known to both the transmitter and the receiver. <A> I assume you're asking specifically about CDMA as used in the cellular telephone system. <S> This tutorial offers some hints. <S> Any particular mobile device gets a frequency/channel assignment by monitoring a control channel that is broadcast by the base station.
Basically, the signal-spreading codes are pre-assigned based on the carrier frequency and the logical channel being used on that frequency.
What does this schematic symbol indicate? (Bent line) I'm looking at a schematics of a power system, and encountered some schematics I find quite strange. As you can see, the schematic contains a lot of bent lines. I have two hypothesis: It indicates jumpers, see this question . It indicates fuses As you can see, the horizontal line in the bottom is labeled "30m Cross Over Jumper Spectron 10". This of course, strengthens hypothesis 1. I think it also makes sense, seeing there are connectors you can connect/disconnect. However, I don't see why you would need three of them for just one single branch. Also, the system is subsea, I don't know if you can use jumpers the same way you do in "normal" systems. I think it looks similar to common symbols for fuses, but again, I don't see why there should be so many. (And fuses on the bottom of the ocean doesn't seem like a particularly good idea). Additional information: The distances are small (from the red arrow and down, the schematic has been updated. Above the red arrow, the cables may be long). The transformer is very close to the load (compressors). The horizontal cable at the bottom goes to an identical parallel setup (100kVA transformer, 36.5 kW load etc.). The entire system is subsea. The power umbilical is several km Update: Here's a more complete schematic. Does anyone know what the symbol means? <Q> It's a flexible connection of some kind. <S> (I will explain this a bit more below.) <S> Supporting my claim - from AS1102.3 Graphical symbols for electrotechnical documentation <S> - Part 103: Conductors and connecting devices <S> , we have: <S> Note AS1102 is based on IEC 617 Graphical symbols for diagrams . <S> Contrast the symbol for a jumper ("connecting link"), also from AS1102.3, and a fuse, from AS1102.7. <S> What's a trailing cable? <S> A trailing or reeling cable is used to power mobile equipment, i.e. a mobile drilling rig, or mobile substation. <S> In this application, I think the 'sub-sea' transformer is in some kind of waterproof container, connected to the surface supply by trailing cables. <S> Flexibility is required for the transformer to be moved around, or to move with the water currents. <S> Note that trailing cables are a special breed, not like regular cables. <S> See Olex catalogue for trailing and reeling cables . <S> Generally these cables are much more flexible than normal cables, are designed to withstand cars running over them, etc. <S> There are also special protection features to detect if the cable has been damaged - these aren't required for normal cables which spend most of their life living in a protected environment, i.e. conduits. <A> It means you have to twist the cable to make it work :-) <S> Just kidding, how about it only indicates an arbitrary length of cable ? <S> Then there may indeed be a notion of "twistability", i.e. the cable does not have a fixed position. <S> The reason for the many cables is the different types of connectors used, necessitated by the water element. <A> Given that the star-delta (\$Y-\Delta\$) transformer is connected on slip rings, some amount of rotation will be expected and as a half-guess I'd say the symbol might imply that the cable could be expected to be twisted (due to the turret rotating). <A> I think you can rule out the fuse idea, the fuse symbol is more of a laid down "S" <S> , this is too steep a curve to be a fuse. <S> It doesn't seem to be any valid symbol <S> but I would suggest it means either flexible, indeterminate or long length. <S> It is similar to the AC signal symbol but again the curves are a bit steep for that. <A> In technical drawings if I remember correctly it is called a foreshortening line indicating something longer than the scale of the drawing can represent. <S> In an electrical drawing a length of wiring or cabling of a specified of variable length. <S> The symbol is also used in architectural and plumbing drawings as well.
In this drawing, it is likely to represent a trailing or reeling cable
What is this tube thing? (Madcatz drum pedal) Could someone help me out, I have no idea what this tube-like thing is. This is from a Madcatz Xbox360 drum kit pedal. The pedal stopped working and I opened the it up and found just this tube thing connected to a wire going into a controller via a 2.5mm headphone jack, that plugs into a PC or Xbox360 with a USB cable. I'm guessing it's a vibration sensor or something (for when the pedal hit's the plastic on the opposite side of this tube), and this is the only electrical component in the pedal. My best guess is that it failed and that's why the pedal isn't working, and I hope it can be replaced. The cord seems fine to me. Photos: http://imgur.com/a/ab4DP <Q> That is a reed switch . <S> It's basically a switch that is closed by a magnet. <S> In your case, it looks like it has a bit of sleeving over one end, possibly to protect it from vibration, but there is nothing else unusual about it. <A> It is a reed switch, but it's more likely your magnet has fell off your pedal than this has broken, They used to make whole keyboards with these! <S> Test it by holding a magnet to it on one side and see if it operates. <A> It closes when a magnet is near. <S> Is there a moving magnet nearby to make the switch open and close? <S> It's also possible that they could have a switch optimized to open under shock (all reeds will do so, but it's not usually desirable). <S> Looks like a ~2mm diameter glass type. <S> Magnetic sensitivity varies between models (over about a 10:1 range). <S> If it really isn't working (they rarely fail) <S> you might be better off getting it from the manufacturer. <S> Here are a few Digikey options for you: <S> http://tinyurl.com/l7sw4zu <S> Based on scaling the printed dimensions for the board, the tube diameter appears to be 2.1mm, give or take a bit.
It looks like a magnetic reed switch.
What is the purpose of this simple 1 capacitor 2 resistor high pass filter? I have seen the standard high pass filter with the -3dB cutoff frequency = \$ 1/2\pi RC\$. simulate this circuit – Schematic created using CircuitLab However I have seen this particular circuit which I'm seeing here and there, especially on the inputs and outputs of ADCs DACs etc . Is the resistor there to limit the input/output current ? Would the -3dB cutoff frequency change at all? If so, what frequency would the new one be at? simulate this circuit <Q> First, that's a high-pass filter. <S> Secondly, if you do not load Vout (on the second circuit), then I think you can see that the series resistance R1 + R2 is equivalent to R1 (on the first circuit), so you can find the -3dB frequency. <S> The output voltage at high frequencies (second circuit) will be \$ V_{OUT} = <S> V_{IN} <S> \cdot \$\$R_2 <S> \over R_1 + R2\$, and <S> the voltage at the cutoff frequency will be -3dB relative to that. <S> To see immediately that it's a high-pass filter, just remember that capacitors act as open circuits at low frequencies (and inductors act as open circuits at high frequencies). <A> What is the purpose of this simple 1 capacitor 2 resistor [high] pass filter? <S> The extra resistor gives you an extra degree of freedom. <S> For the standard RC high-pass filter in the first schematic, the transfer function is $$H(j\omega) = <S> \frac{j\omega R_1C}{1 <S> + j\omega R_1C} $$ <S> So, the asymptotic high frequency gain is 1 and the corner frequency is \$f_c=\frac{1}{2\pi R_1 C}\$. <S> But what if you want something different than 1 for the high frequency gain? <S> Add another resistor . <S> It's straightforward to show that, for the second schematic, the transfer function is $$H(j \omega) = <S> \frac{R_2}{R_S}\frac{j <S> \omega <S> R_SC}{1 + <S> j \omega <S> R_SC}$$ <S> where <S> $$R_S = <S> R_1 + R_2$$ <S> So, you still have the high-pass filter but now, the asymptotic high frequency gain is \$\frac{R_2}{R_S}\$ and the corner frequency is \$f_c=\frac{1}{2\pi R_S C}\$. <A> Spehro gave you the answer, now let me tell you why you could (should?) have known that by looking at the circuit. <S> Two resistors in series are indistinguishable from one resistor with the sum of the two resistances. <S> (I hope you knew this?) <S> Hence when we take Vout in the second circuit from the R1/C1 junction, we have exactly the same circuit as the first (but with R1' = R1 + R2). <S> But instead we take the output from the R1/R2 junction. <S> These two resistors form a pure resistive voltage divider, for which frequency is totally irrelevant. <S> So the fact that we take the output from R1/R2 instead of from C1/R1 can't influence the frequency response, except from the constant factor R2/(R1+R2). <A> It's NOT a lowpass filter, it's a highpass filter, often used to block DC. <S> The divider is presumably used to scale the input to an appropriate range for whatever is connected to Vout. <S> Assuming the load on Vout is infinite impedance, the corner frequency should be - $$ f = \frac{1}{2 <S> \pi (R1 + R2) <S> C}$$ <S> At frequencies much higher than the cutoff, the transfer function approaches - $$\dfrac{R2}{(R1+R2)}$$ <A> The circuit in question is also high-pass filter, just like the typical cap + resistor one you show. <S> But the added resistor provides level shifting. <S> R1 and R2 create a voltage divider, without affecting the frequency response that C1 + Rt high pass filter creates. <S> Simply put, it is a high-pass filter + level shifter .
This is a filter with a resistor divider.
Is the battery being drained? I'm building a simple intrusion alarm system with a piezo buzzer fed by a 9V battery, I have a switch to activate/deactivate the alarm, and a trigger (like a switch) connected to a tripwire so if someone goes through the wire the alarm is set off. My question is which of these configurations (A or B) is better in terms of saving battery life (so that the battery lasts longer if there is never an intruder), is there even a difference between the 2 configurations. I'm a newbie. Conf A: Conf B: Which one would you use? <Q> Is the battery being drained? <S> Yes. <S> Yes it is. <S> By it's internal self-discharge rate. <S> See <S> How do I calculate the self discharge rate of a lead acid battery? <S> Nothing you can do about that, other than use the battery before it can discharge itself first. <S> Which of these configurations (A or B) is better in terms of saving battery life (so that the battery lasts longer if there is never an intruder) <S> Neither is better. <S> is there even a difference between the 2 configurations. <S> I'm a newbie. <S> There is no difference. <S> A disconnected series circuit is disconnected, no current can flow (not getting into high voltage and arcing across air gaps). <A> In an open circuit, no current flows, so the battery should last as long as its normal shelf life (i.e. not in use). <S> To answer your question "Which one would you use? <S> " Since they are electrically equivalent, I would use whatever one was more convenient and matched the physical layout. <S> (To avoid having to run extra wire, for example.) <A> There is only a single simple circuit and "trigger" breaks it in both instances. <S> Both circuits are equivalent even though the components are in different orders.
Both configurations are effectively identical.
Avoid inductive coupling on two near coils I have two coils that are placed parallel from each other and separated by a mere 1.5cm, lets say A and B. The core of them is built using soft iron. Right now they are wired and built in the same way. Is there any way that I can use to prevent the induction from coil A to coil B when coil A is being pulsed by a DC current? If I place a scope with a channel on each coil, coil B shows the same pulsing frequency than coil A but with a reduced voltage. Is there any way that I can use to avoid this behavior? Or this is how it should be and by physics it can't be avoided? <Q> Place the coils perpendicular to eachother or use a shielded inductors. <S> If none of these options are possible you could make a shielding out of mu-metal. <S> It provides a good shielding for low frequency magnetic fields. <A> The problem arises when the core material is low permeability or, (as in the case of a lot of inductors), there is a significant air-gap. <S> This is because the magnetic field "fringes" due to air carrying the flux. <S> The coupling also depends on operating frequency. <S> Induced voltage is N\$\dfrac{d\phi}{dt}\$ and the rate of change of flux is proportional to frequency. <S> However, flux is also dependent on the ampere-turns in the "transmitting" coil and as frequency rises (for a fixed inductance value), current falls proportionally. <S> There comes a frequency (and this is beyond my memory at the moment) where the choice of "protection" changes from using high permeability material to using a solid conductor between the coils. <S> At low frequencies, the high permeability material allows flux to be taken away from a sensitive "area" and return it back to the original source; in effect the fringing that splays out from the "rogue" field is kind of short circuited by a low reluctance path that bridges north and south. <S> At higher frequencies solid copper (or even silver) <S> conductor sheets become more effective and you see this type of thing in radios - a square shaped can sits over an inductor. <S> Why does mu metal get worse at higher frequencies - mu metal's "effective" permeability reduces with frequency (due to eddy currents increasing) and it becomes less effective as frequency increases. <S> The two effects tend to cancel but, because mu metal is a relatively poor conductor (compared to Cu) <S> it doesn't do the job that a good Cu conductor does at high frequencies - the eddy currents induced in copper are many times that produced in (say for instance) iron or mu metal. <S> Where do you pitch the protection - both can be the best solution but one may be just as good as both if the frequency is low or high. <A> Toroid inductors will exhibit less coupling than other types, and as others have pointed out mounting them orthogonally to each other will also limit coupling. <S> Once you've done those two things you should have very little coupling, but if you need to go further you can add magnetic shielding, separate them further apart, and simply design your circuit differently so coupling isn't a problem. <A> As you can observe the effect, you can minimise it by rotating each coil until it has the least effect on the other coil. <S> Then fix the coils in that position.
If the two "independent" coils are each wound on gap-less high permeability cores then coupling is greatly reduced. Air is a poor concentrator of flux and coupling can happen because the lines of flux "spread-out".
Is rms value of a positive varying DC voltage same with its mean value? I know that rms of an AC is totally different than its mean. But what if the voltage is not alternating(DC) but varying by time. For example a noise with a huge offset. How is varying DC measured by voltmeters? Mean or rms? Or as in my question are they the same thing for a varying DC? <Q> The rms voltage is given by <S> \$\sqrt{\frac{1}{t_1-t_0}\int_{t_0}^{t_1}v^2(t) \mathrm dt}\$ <S> The mean voltage is given by <S> \$\frac{1}{t_1-t_0}\int_{t_0}^{t_1}v(t) <S> \mathrm <S> dt\$ <S> As you can see, these are not the same, except in special cases. <S> A pure positive dc voltage is one such special case. <S> However, if the dc component of voltage is much bigger than any ac components, the rms and mean will be very close to each other. <S> This could apply to the case of "noise with a huge offset". <A> Varying DC is AC. <S> RMS is "Root Mean Square", which is the square root of the average of the square. <S> The term "average" is a clue that some time judgement is envolved. <S> For a repeating signal, that would usually be the repetion period. <S> For something else, you have to decide over what time interval you are going to average or low pass filter to get a answer, as apposed to waiting longer and getting a more "averaged" answer. <S> If the signal is varying so slowly that you consider it a "fixed" value that is changing a little over time, then the RMS value is the same as the instantaeous value. <S> In that sense, you can say the RMS value is going up and down with the voltage of the signal. <S> However, then the distinction between RMS and instantaneous voltage is not useful. <S> Usually we apply "RMS" to signals that change fast enough compared to our period of relevance. <S> For example, a resistor will heat up proportional to the square of the RMS voltage applied to it. <S> 100 VDC and 100 VAC create the same heating, as long as the AC frequency is "high" compared to time scales we care about. <S> For heating coils in a toaster, 50 or 60 Hz is much faster than our time scale, so RMS makes sense in that context. <A> How is varying DC measured by voltmeters? <S> Mean or rms? <S> Or as in my question are they the same thing for a varying DC? <S> Think of a DC voltmeter as it used to be - a moving coil meter with a needle pointing to the number on the scale. <S> A steady dc voltage meant the needle moved to a certain position and the correct voltage was indicated. <S> If that dc voltage were superimposed with a high frequency alternating waveform that mathematically didn't alter the average dc voltage, then the meter's needle would not change position. <S> The problem arises when the alternating part slows down and the meter's needle is seen to fluctuate around the "mean" position. <S> The mass of the needle isn't enough to stop the meter indicating the fluctuations. <S> Even RMS meters suffer from the same dilemma - what time constant do you choose to make the measurement over OR, how much mass should the needle system have? <S> More mass means longer times to respond to a regular dc voltage being placed at its terminals. <S> It's a compromise. <S> It's exactly the same problem for digital meters - what time constant do you choose when making a measurement. <A> DC implies all positive numbers, if a portion of you signal voltage and current go below zero then you have to us RMS to figure power. <S> RMS current and or Voltage is how we measure power. <S> Power = <S> I <S> * <S> V is simply that. <S> RMS is assumed that the voltage will go negative in most cases 50% of the time 120V AC (Alternating Current) <S> so we take the square of the number and that gives us an positive value. <S> If at any time your signal goes below zero then you must use RMS to find, RMS power. <S> It all depends on what you want to measure.
RMS and average or mean is the same thing when looking at voltage and current that are in one direction in other words all positive values (DC values, direct flow in one direction).
Possible to charge one phone off another? What's stopping the ability of charging a cell phone from another cell phone? If I were to create a crossover/patch USB cable and connect it between two phones or tablets, would there by any way to have one of their USB ports provide a charge to the other? <Q> Most phones are USB Peripherals (Slaves). <S> They do not provide power on the USB VCC pin. <S> So it won't work at all that way. <S> They can provide power over the usb pins, like a host. <S> Some need to be hacked/modded/rooted to do this. <S> Even then, some phones need power injector cables because they can only do OTG data, not provide power. <S> Mostly, it's very impractical to rely on. <S> Just get a usb portable battery pack. <A> Most phones are not designed to output power on the USB power pin. <S> Even if the USB power pin on the donor cell phone has *some connection <S> *** <S> to the battery, most phones use single cell Lithium battery, which works around +3.7V. USB power <S> is +5V. <S> The recipient cell phone expects +5V. <S> ** through body diodes of the MOSFETs in the charger, for example <S> To provide +5V to USB OTG (see the post by @Passerby in this thread ), the cell phone would need a step-up converter to boost from +3.7V to +5V. <S> It's possible to have a +3.7V to +5V <S> boost converter in the "transfusion cable", though. <S> In any event, the success of the "transfusion" would depend heavily on the design of the battery charge controller in each particular cell phone. <S> Such charge controllers are not obligated to follow a standard (such as USB). <S> There is no guarantee that the USB power pin on the donor cell phone will be "back-powered" from the battery. <A> It depends on the connection cable. <S> I coupled following two OTG enabled devices to test charging one phone with other. <S> Xiomi RedMi 4 <S> (Android v6.0.1 Smartphone, 4100mAh <S> Li-Polymer battery) <S> Lenovo A3300-HV <S> (Android v4.2 Tablet, 3500mAh <S> Li-ion battery). <S> OTG of both devices works fine with SanDisk 16GB pendrive. <S> I used one micro USB male to OTG female converter (Which we use to connect pen-drive with phone <S> , I'll say it OTG cable) and one USB male to micro USB male converter (Ordinary data cable, I'll say it Data Cable). <S> Any one of the android device was connected to OTG cable and the other was connected to Data cable. <S> The female socket of OTG cable was connected to male socket of Data cable. <S> I found the device connected to Data Cable is always sucking power from the device connected to OTG. <S> When The Lenovo tablet is connected to OTG Cable and Redmi 4 is connected to Data cable, I found the Redmi 4 is sucking charge. <S> While the same Redmi 4 is connected to OTG and Lenovo one is with Data Cable, the Lenovo is sucking charge from Redmi 4. <S> So, my conclusion is the microUSB to USB connection is not one-to-one. <S> It do some voltage and signal conversion to make one device charge source and other chargeable. <S> I'm not really very clear about this point. <S> I can't say what happen in case both the device are directly connected using a microUSB male to microUSB male cable. <S> But I expect such cable must have some functionality to mark devices connected to one side as source and other side as peer.
Some phones have USB OTG capability.
What sort of a ferrite core will I need to make core memory? I am building a homebrew computer using core memory. What sort of a ferrite core will I need? <Q> Look for a core that saturates in a low H field (lower power needed) and the core should have a wide hysteresis curve so that it stays magnetized when current is removed. <S> No air gaps of course. <A> You should consider to purchase an old core memory plane from an ancient computer. <S> You could connect your own circuits to drive the plane and save the huge amount of work trying to wire up 1000's of magnetic cores. <S> You could even just use one corner of the plane if your computer project needs a small amount of memory. <S> Check eBay - you can find a fair number of folks selling core memory planes. <S> Here is one example: <A> You might find it easier using four wires through each core. <S> X driveY drive Sense and digit inhibit by using two diodes on the end of each drive wire <S> you can reduce the number of bidirectional drivers to something like the square root of the number or x wires you then need the same for the y wires. <S> This will work for any number of bits ie planes in the stack. <S> You will need a sense amplifier for each digit and a digit inhibit wire for each bit. <S> TI use to make chips for doing the bidirectional driving.
Try ferroxcube, they do a good range.
Measuring AC voltage from DC battery When measuring the AC voltage across a DC battery (CR2032), and I am getting 6v.The DC voltage across it is 3.01 volts.I also tested on a 9 volt battery; again the same thing. I am reading about 20 v AC and 10v DC.I am using MASTECH MAS830L multi meter. I also used another multimeter, and I get the same result. When I am putting the multimeter probes in the same polarity with the battery, I am getting the AC voltage, but none if I put the probes in reverse polarity. Why is this happening? <Q> This is the clue to what is happening - <S> "nothing" when you connect in reverse means that the meter uses a simple precision half wave rectifier to convert AC to a rational DC voltage. <S> I'm guessing the meter makes no claims to measure RMS AC voltage - <S> it assumes the AC voltage is a sine wave and, the output from the precision rectifier is averaged (with a filter) to give a "steady value" that is representative of the AC RMS value. <S> The problem is that this "steady value" will be about 50% of the AC RMS value and, if the inputted voltage is always at a peak value (because it is DC), then the steady-value will also be the peak value hence, with a 3 V battery, the steady-value measured by the meter is 3 V (the meter doesn't know any better and indicates that it is measuring a 6 V AC voltage). <S> If it were a 6V AC source it would see about 3V. <A> provided that the input is pure sine wave. <S> When you are measuring a DC source in AC mode, the applied correction factor is completely off because the input is not a sine wave. <S> This is common behavior for somewhat cheaper range multimeters. <S> The typical use case for these multimeters in AC mode is mains supply AC. <S> Only if you buy a true-RMS meter the display will be accurate, but these meters are much more expensive than one you have now. <S> Perhaps starting from 100 or 150€. <A> First of all your meter it is not brocken, does not have internal DC blocking for the AC functions, and battery does not have any AC component. <S> In AC mode your meter runs the voltage input signal through a half wave diode rectifier (just like the old VOM), takes a time average of the result, and then multiplies by a constant factor. <S> What is this factor? <S> In case that is measure peak and then calculate the RMS the result will be 0.71 times the DC voltage. <S> But in your case it is averages the waveform and multiply by which is about 2.2 <S> When connect a DC voltage at AC input, the meter does the same thing as for a sine wave, i.e. passes the signal through a diode, multiplies the time average of the result by 2.2, and displays that. <S> But for a DC voltage, passing through a diode (in foreword direction passes quite nicely) does nothing, and the average of a constant voltage is just the voltage itself. <S> So the meter displays 2.2 times the voltage. <S> You can verify the above doing this <S> : Take a low amplitude sinewave signal from your function generator (namely 5~10V/50~60Hz) and measure with your DMM in AC scale. <S> Next pass this through a diode and measure in DC scale, then multiply by 2.22. <S> If you want to block the DC component from AC signal, connect a 100nF capacitor in series with the red lead of your multimeter. <S> The capacitor should be rated more than the peak-to-peak voltage you are going to measure. <S> This capacitor in series with your meter input 10MΩ resistance will make a cutoff frequency from 20~30Hz (-3dB). <S> But still you don't have an RMS multimeter as well as you <S> you can't use this meter to read ripple on a DC supply.
When I am putting the multimeter probes in the same polarity with the battery, I am getting the AC voltage, but none if I put the probes in reverse polarity. Your multimeter uses a simple trick to measure AC voltages and it is pretty accurate
Does free electrons from the conductor itself flow or electrons inside the battery flow? I am new to electronics. I read electricity works this way: some atoms have more electrons than protons. These free electrons flow through a conductor such as a copper wire. However, to induce flow of electrons we need a source to push the electrons such as a battery. Does this mean the free electrons from the conductor itself (copper) flow or does that mean electrons inside the battery flows? (If free electrons from the copper flow, wouldn't copper eventually run out of its free electrons?) <Q> some atoms have more electrons than protons? <S> No, they have the same number but some of the electrons have more freedom to move. <S> Does this mean the free electrons from the conductor itself (copper) flow? <S> Yes. <S> They jiggle about randomly relatively fast (~2 <S> x 10^ <S> 6 m/s). <S> In the presence of an electric field, they very slowly drift in one direction ( ~1 m/h). <S> wouldn't copper run eventually run of its' free electrons? <S> No, as many are added at one end of a piece of copper as are lost at the other end. <S> See <S> How fast does electricity flow? <S> Do electrons actually flow when a voltage is applied? <S> Understanding Electrical Engineering with Analogies <S> How electron movement produces current,instead of having a slow drift speed? <A> free electrons are present both in conductor and source. <S> These electrons are only drifted by the potential difference across the voltage source. <S> That means electrons are circulating in a closed loop, so the number of electrons flowing out of the conductor is equal to the number of electrons entering the conductor. <S> So as you think the conductor wont run off its free electrons. <A> If you're happy with circuit powered by a battery then what happens in that situation is that there are "free" electrons produced by the chemical reaction at the negative plate. <S> At the positive plate, a chemical reaction cannot occur because in order for it to occur, "extra" electrons are required. <S> In a lead-acid battery, the number of electrons produced at the negative terminal is exactly the number needed by the positive terminal. <S> This "need" is really an electric field. <S> The "need" at the positive plate "pulls" the "free" electrons from the negative plate through the copper wire so that it can complete a chemical interaction. <S> Disclaimer: <S> Quotation marks are used to indicate that some liberty is being exercised for purposes of demonstration. <A> Good curiosity! <S> Sometimes people don't think about how the electricity travels as long as their circuit works but most Professional Engineers or hobiest would know this for sure. <S> Electricity flows with Voltage (energy of electrons or charge as charge is directly proportional to #of electrons). <S> It is the battery that is the source of electrons and holes otherwise battery would not have been called a source! <S> So, the chemical reaction inside a battery generate cations and anions that are generated at two terminals "+" and "-". <S> As long as they are connected through your circuit electrons and holes find a path to travel. <S> An electron from a battery terminal doesn't necessarily have to flow from "-" end to another end of the "+" terminal but think of them as like a series of electrons in a line (the motion is quite shattered inside bad conductors but pretty smooth and conductive in copper wire) push each other. <S> Same thing with holes but in reverse direction, as absence of electron is hole. <S> So, depending on the voltage (which depends on intensity of chemical reaction inside a battery) and the circuit impedance, number of electrons/holes travel through copper. <S> That electron might be belong to the copper or the battery as they tend to push each other to create a electron motion. <S> Remember, <S> electron travel speed is much slower (as they just have to hit and pass the energy to next electron) than the motion created by the real electricity. <S> After a long consumption of charge, the chemical process inside a battery slows down and therefore, the energy in your charge is less so, less force to push electrons and <S> thus your battery starts giving lower voltage than its regular voltage.
The copper is just a medium that allow electrons to move freely.
Why use 2 isolated grounds in Mackie 220W Power Supply? I recently took apart a Mackie 220W power supply for an analog sound board. Much to my surprise I found the following scheme: Earth grounded:48V-18V18V Seperate, isolated ground:12V5V I am not sure if this has something to do with it being a supply for a sound board, but why would there be 2 isolated grounds? <Q> First we need to realize that this power supply for a large format mixing console, probably with about 40 channels, and 16 mix buses. <S> As a result, there is a need for multiple supply rails. <S> This breakdown may not be exact for the console that goes with the power supply, but in general: 48V is always the phantom power bus +/- <S> 18V is for all the audio circuitry, and contains a +24dBu signal with 1.2V headroom at each rail. <S> 12V powers any cooling fans and goose neck lights <S> 5V powers any digital logic for mute groups, scene memory, etc. <S> The +/-18V rails need to be earth referenced by convention, otherwise ground loops will be a problem when the console is interfaced with other equipment downstream. <S> The 48V bus also interfaces directly with audio circuitry, so must be referenced to the same ground. <S> The 12V and 5V buses are powering electrically noisy things. <S> To keep that noise out of the audio signals, they need to be kept isolated from the audio ground. <A> It really depends on the power rating, application of device and noise immunity requirements for your ICs in your device. <S> This is also implemented on the PCBs as well. <S> i.e <S> No designers would like to ground 10 A power signal and 100 MHz signals sharing the same plane. <S> It may or may not help, but definitely a safe side for the design. <A> Are you sure that tere is no any DSP in your device?Usually <S> they are supposed to be there to provide noise immunity. <S> Actually the digital part of any circuit is very much noisy due to switching. <S> To avoide couple digital noise onto sensitive analog signals it is separated from analog part by using separate GND.It <S> is common not only in PCB to have two separate ground planes, but also inside the ADC/DAC or DSP chips. <S> You will see in schematic diagrams multiple ground symbols, that's usually a good place to start looking for the source of the problems. <S> EDITIf <S> it is all analogue, <S> may be the separate power used to supply the independend protections circuitry. <A> It's hard to tell without knowing what the exact specifications of the sound board are, however, one of the main reasons to have isolated grounds is to guarantee precise and stable power supply to a part of the system that might need it. <S> Providing a very stable and precise power supply can be quite expensive and at high voltage or current conditions it gets harder and trickier and more expensive, and most times all that precision and stability are only necessary in very specific parts of the system (usually at low voltage and current conditions), and not in the high power ones, under those circumstances it makes sense to have isolated grounds (a very stable one and a not-that-stable one) since a shared ground can carry all sorts of undesirable noise and mess up the stable supply. <S> The perfect example is a digital power amplifier, where you don't want your fragile digital circuits or pre-amplifiers to get disturbed by the wild transients (and noise in general) that external sources and the power amplifier might induce in its own power supply.
Sometimes, designers like to have separate grounds for digital and analog signals or power and the small-voltage signals to keep the controls and data signals away from the Ground noise errors.
How can I control a LED with two separate control circuits? I have a LED controlled by a microcontroller. I want to know how I can bypass this microcontroller so that I can control the LED with a separate current. Would I use transistors to switch between the two controllers to prevent backflow damage to my microcontroller? If so how? <Q> Left circuit: If either controller wants the LED on, it turns on. <S> High = ' <S> on' Right circuit: If either controller wants the LED off, it turns off. <S> High = 'off' simulate this circuit – <S> Schematic created using CircuitLab <A> You could probably use a open collector configuration. <S> simulate this circuit – <S> Schematic created using CircuitLab Something similar to this. <S> Connect the microcontroller to one input and the other source to the other. <S> Both inputs can turn the LED on. <A> How about if you wanted to control the LED from more that two places - how about 4. <S> What about being able to reverse the demand from one input - how could you do that. <S> I'm aware that this is beyond the scope of the question <S> but it's fun to answer: <S> - This circuit can control an LED from 4 independent places using an analogue switch(es) to invert state previously set. <S> For simplicity (2 sources) just omit the two middle sets of analogue switches. <S> It's also known as a 2-way light switch. <S> It's also know as an Exclusive OR gate so if you want to "reverse" the "demand" from source A, feed it through a 2-input EX-OR gate and have source B connected to the other input. <A> Check the datasheet for the microcontroller and look for I/ <S> O pins maximum sink current (low voltage). <S> It is usually either higher or the same as the maximum source current (VDD voltage). <S> This should work with either open-drain or push-pull outputs. <S> The diodes block the pins on one microcontroller from feeding into the other. <S> When sizing the resistor R1, you now need to account for the voltage drop across the LED as well as the 0.7v voltage drop across the 1N4148 diodes.
If the pins on your microcontroller can sink enough current to drive the LED (usually between 10 and 20 ma), then you don't need any transistors at all -- just two diodes.
Switching between several high power DC devices? I would like to control several high power DC devices (12V DC LEDs). From a tutorial, I found that I can control these using a 3.3V PWM input and a MOSFET. From what I understand, the MOSFET only allows current to flow through the LED to ground when the PWM input is high. I have several (lets say 4) of these LEDs and want to be able to select which one I am controlling. If I could activate the LEDs directly using the 3.3V PWM, then I would probably try to do something like this: Get a 2 to 4 bit decoder. Connect 2 output pins from the controlling device to the 2 select pins of the decoder. Get 4 AND gates. Using the AND gates, AND together each of the 4 outputs of the decoder with the single PWM output from the controlling device. Connect the outputs of the AND gates to the LEDs. I think this would work (please correct me if I'm wrong). If I got one MOSFET per LED, then this approach could still work with the higher power devices that I can't directly control. My two questions are: Does this approach make sense? Is there a way to accomplish this using only a single MOSFET? <Q> You can skip step 3 if you get a decoder with an enable input, e.g. 74HC238. <S> You will still need one sink per device you want to switch though. <A> You haven't stated the LED current so this approach may not yield a definite result. <S> This one might work for you: - If you use the correct package 200mA is the max current <S> but you might be able to current share with two devices. <S> It all totally depends on the LED spec. <S> There are possibly higher power multiplxers as well. <A> Does this approach make sense? <S> Yes, it might work. <S> However, the real question is if this is what you really want. <S> Being able to choose a single LED to power at a time is less useful than being able to power all LEDs simultaneously. <S> And the fact is that this latter version is simpler and requires less components, while providing more flexibility. <S> So I see no point in doing the original version. <S> Is there a way to accomplish this using only a single MOSFET? <S> Only if the LEDs are of so little power that an IC is enough to power them (15-20mA/output). <S> Power LEDs usually require larger currents, for which you need some external power switching device (a MOSFET or a transistor).
Connect the PWM output to the enable input and this will switch the decoded output on and off with the PWM signal. Why don't you look for an analogue multiplexer that can run from a 12V power supply and has low on-resistance and can take the current for one LED.
convert self-powered speakers to passive Is it possible to convert a self-powered speaker into a passive one?(and if yes, how?) My scenario:I have an old pair of PC speakers i'd like to use with my portable MP3 player even if there is no power outlet nearby... <Q> Most headphone amplifiers are designed to drive at least 8 Ohm load. <S> The speakers can have different resistance, but 4 and 8 Ohm speakers are quite widespread, and 2, 16, 60 Ohm or even more are rare. <S> If your speakers' resistance is at least 8 Ohm, it's possible to use them with your MP3 player just like headphones. <S> The use of this application is another question - the volume will be so low that you will need to hold the speakers close to your ears, just like headphones :) <A> Passive speakers like the Sony SRS-P7 are cheap headphone type speakers combined with acoustic amplification. <S> A carefully designed sound channel amplifies the audio. <S> Like cupping your hands to make your yelling louder, or sticking a cellphone in a bowl (I use a roll of blue painters tape, it really works well). <S> There's a limit to what can be done based on the size of the enclosure. <S> Active speakers on the other hand, are typically directly facing the outside. <S> To modify an active speaker into a passive one, would need new speakers and some manufacturing of a sound channel (Using a router or plastic injection moulding or 3d printer, etc) <S> And the speakers themselves will need to be resized. <S> Essentially, the only thing you would keep is the audio cable and the case. <S> Not practical or pragmatic. <S> Hit a dollar store. <A> I have an old pair of PC speakers <S> i'd like to use with my portable MP3 player even if there is no power outlet nearby... <S> You could build a battery-powered power supply. <S> This could be a few AA batteries or lithium-ion battery with a regulator and a separate charging circuit. <S> There is likely to be spare space inside at least one of the enclosures (though this might affect accoustics).
Buy a portable mp3 player speaker case, or a set of passive speakers... The best thing you can do would replace the power and amplifier circuits with a battery powered one.
Charge at 24v and discharge at 12v for battery system Is my thinking correct. Below is a simple diagram of the concept I want to check. Is this:1: Possible2: Feasible? I.E are there any concerns or foreseen issues with this design? Edit: <Q> It will work fine as long as gray and brown wires are not present at the same time. <S> The diodes are redundant, they don't fix anything - they will prevent a short-circuit present when both green and brown wires are attached, but the output won't be 12V. <S> I don't see why you simply won't keep the 12V parallel connection of batteries and charge them from a 12V charger? <S> Let's not forget that the ideal charging situation is when each battery cell is handled by an individual charger. <S> In a 12V lead-acid battery there are 6 cells, each with 2.0V nominal voltage. <S> Ideally, the cell-to-cell links would be exposed, and one would use a 7-wire connection to the battery for both charging and discharging (with a charge/discharge controller). <S> This is the ideal scenario and maximizes battery life. <S> This is how electric cars and professionally designed battery packs are made (in contrast to cheap junk). <S> So, even the situation with a 12V battery used as a unit is less than ideal since there's 6 cells in series, without individual cell management. <S> By connecting two of the batteries in series, you're making things even worse. <A> On the second diagram why don't you add the fifth diode between battery A and B so that the power supplied from D4 & D2 <S> doesn't short the 12V output/motor output due to the grey wire that connects the two wires D2&D4. <S> I think the fifth diode can separate the and allow the flow of series to flow from negative to positive which is a normal flow of series connection. <S> Not 100% sure but its just a suggestion. <A> <A> Don't use diodes as those will prevent the 24 V charger from charging the batteries correctly. <S> Use switches as advised, or power connectors (my personal choice) to switch between series and parallel configuration. <S> Adittionally, put a correctly rated fuse in series with each of the batteries since batteries really are quite dangerous.
I think It would work if the 12v output was connected to only 1 battery you could wire a second 12v output to the other battery I'm looking into this for my camp trailer solar setup
How to connect a Inductive Proximity Sensor Switch NPN DC6-36V to PIC18F4550 5V I have got a LJ12A3-4-Z/BX Inductive Proximity Sensor Switch NPN DC6-36V with this Specifications: Model: LJ12A3-4-Z/BX Theory: Inductive Type Sensor Wire Type: Cylindrical DC 3 Wire Type Output Type: NPN Detecting Distance: 4mm Supply Voltage: DC6-36V Current Output: 300 mA Response Frequency: 100Hz Detect Object: Iron (I use 12V or 8V to supply one sensor) this should be connected to this ports of a pic (one sensor per limit): what do I need optocouplers etc.? <Q> You can use an optocoupler as follows: simulate this circuit – <S> Schematic created using CircuitLab Choose an optoisolator that has more that sufficient CTR such as a TLP291-4(GB,E). <S> The 12V supply that powers the proximity detectors does not need to share a ground (and probably should not share a ground) with the microcontroller. <S> Edit: If you want a through-hole package, one suitable type is the TLP624-4(F) <A> simulate this circuit – Schematic created using CircuitLab <S> For a 3D printer application with a RAMPS 1.4 and Arduino Mega 2650, I had the best success with putting a diode in series on the black line/signal line of the sensor. <S> The cathode connects to the black wire of the sensor and the anode connects to the Arduino through the RAMPS board. <S> I configured the Arduino with a pull-up on the input port. <S> The sensor is powered at 12V through the brown wire and ground through the blue wire provided by the RAMPS board. <A> I'd do some more research on this part. <S> I did a quick Google <S> and I think you have the colours of your wires wrong. <S> Brown appears to be positive supply voltage with black as ground although, on another document it had blue and black reversed. <S> I would also suggest that if it is an NPN output it will produce a "contact" closure to the most negative wire. <S> Your drawing in your question is debatable too. <S> It shows a "+" symbol by the brown wire yet your diagram indicates +power arrives on the black wire. <S> Below is something I would expect to find for your sensor but there seems to be contradictions as to what the three wires do. <S> Here are the anomalies I found: - <A> What anomolies? <S> There are NONE. <S> You're confused. <S> Those drawings show the hookup OUTSIDE the sensors. <S> The NPN one connects the load to ground when it detects metal (NO) or not (NC). <S> The PNP one connects the load to power when it detects metal (NO) or not (NC). <S> Consequently they show the load for the NPN between power and the black wire since the black wire goes to ground when the sensor is active and they show the load between the black wire and ground for the PNP sensor because it connects the load to power when active. <S> Those drawings are correct but they sure are confusing! <S> Yeah, black is not ground? <S> Good going there Mr. Manufacturer! <S> And why the optocoupler? <S> Thats only really necessary if you need complete isolation between the sensor and the control/micro board. <S> I don't see the need for that here. <S> With the sensor the OP stated they have, now the digital signal to the micro will be high when metal is detected, low when not. <S> If its noisy, hang a cap to ground on the base of the transistor to act as a noise filter ( <S> 0.1uF for starters <S> but you can go higher if necessary) <S> Something along the lines of a 2n3904, 2n2222 or equivalent would work nicely.
You can get such optoisolators 4 to a package, so only two would be required. If its a short connection and not too noisy an environment, just use a small signal NPN transistor with a base resistor (10K should work nicely) and a pullup to 5V on the collector and run the collector to your micro input.
What to plug in first to usb charger when charging: wall outlet or cell phone and why? I asked this question on Physics StackExchange but was advised to ask it here. When I charge me cell phone or notebook or whatever device what should I plug in first? Should I at first plug in usb charger to the AC wall outlet and only then to the cell phone or vice versa? What are the precise physical arguments for this? And are there any differencies at all?I think it is safer to plug in wall outlet first because of peak charge. Can someone give me a technical explanation?Thanks in advance. <Q> Such chargers 1 are (at least, supposed to be ) basically just constant-voltage supplies, i.e. whenever connected to AC power they should offer the specified voltage, no matter if a device is already connected. <S> For a modern switching power supply , there's quite a lot of circuitry included that makes sure this goal is met pretty reliably, so indeed you don't need to worry about anything here. <S> But older power supplies are often built much simpler: occasionally, these would consist only of a transformer and a roughly smoothened rectifier. <S> simulate this circuit – <S> Schematic created using CircuitLab <S> When connected to a device while not on AC, nothing much happens at all (a simple diode can make sure no current is "draining back" from the batteries), so we shouldn't worry about that. <S> However, the other case, connected to AC but not to any device, is not so uncritical. <S> The thing about transformers is, they only work properly (in the sense of, providing a fixed ratio between the voltages on both sides) <S> when there's a current in both windings. <S> However, when running idle, the voltage in the secondary coil exceeds the nominal voltage. <S> That's especially a concern because the smoothening capacitor will then charge up to that voltage, and if you connect a device at that instant it may suffer damage from the excess voltage. <S> 1 <S> Note that a properly designed actual battery charger is not a constant-voltage supply, but the part that controls this is nowadays build into the device rather than the power supply. <A> Any reputable brand of charger will not create an output surge on startup - which is the main thing to be concerned about. <S> Starting a supply while loaded will place larger stresses on it than otherwise, but modern chargers must anticipate and accommodate this without damage. <S> The circuit example supplied by leftaroundabout may have a preferred mode of us <S> BUT no modern charger in any way resembles this circuit. <S> If you looked for a cheap enough poorly built and non designed enough charger you may have problems, but the equivalent is true in any situation. <A> It shouldn't make any difference. <S> Assuming you have a regulated supply, which is virtually always the case with a cell phone, then if you plug the charger in first, followed by the cell phone, then of course the charger will have a regulated 5v at its output. <S> This probably is how must people charge their phones, plugging the charger in first. <S> But if you plug the phone into the charger, and then plug the charger into the wall, there will not be any harmful voltage spikes, because 1) <S> the charger is going to ramp up from 0 to 5v, and not start at some higher voltage and drop to 5v; and 2) the time it takes to go from 0 to 5v for most switching regulators is usually significantly less than a millisecond. <S> If you have an unregulated supply (not for a cell phone, but some other electronic device), then the "no-load" voltage of the power supply may be significantly greater then the rated voltage; for example 9v for a 5v supply. <S> Here it may make a slight difference <S> what order you plug them in. <S> If you plug the power supply in first, it is going to be at (say) <S> 9v, until you plug in the electronic device, and then its load will bring the supply down to somewhere around its rated 5v. <S> Note in this case, you will always be starting at a higher voltage than the rated voltage since the power supply has already plateaued at the no-load voltage. <S> Since you are starting from 0 instead of the no-load voltage and ramping up, the device will certainly be subject to an over-voltage condition for a shorter period of time. <A> It is not just the matter of circuitry, but mechanically joining the conductors, too. <S> When you try to connect your charger to outlet, or usb to its port, it is not always a smooth connection, but you might connect and disconnect them few times before the connection becomes (mechanically) stable. <S> So, I would recommend connecting the usb port first, and then connect the AC, so that circuitry in the charger reduces the surge of connecting the AC. <A> What people commonly call chargers are really just transformers followed by a rectifier and possibly a regulator. <S> If you plug the "charger" (the charger is actually the circuit that controls the battery charge from that supply) without the cellphone, it's basically an open-ended transformer: the only current drawn is the one from the iron losses and the creation of the field within the transformer, which is small. <S> Plugging your phone in at that stage is just like switching a switch on. <S> As for the other way around, the transformer will be ramping up because of the inductor. <S> The first rule of design is "never trust the user". <S> If it really mattered there would be warnings, but I agree that understanding is always better. <S> P.S: USB chargers are assumed. <S> As tcrosley said it might actually matter for different chargers
If you plug the device into the power supply first, and then plug the power supply into the wall, then there may or may not be a temporary spike above the rated voltage depending on the load imposed by the electronic device. With any modern "electronic" charger it should make no difference - it should be safe "by design" in either case.
What if I have a voltage between ground neutral? What does it mean when there is voltage between ground and neutral (220V) and between phase and neutral (220V) but no voltage between phase and ground (0V)? What could happen? Is it safe? Is it normal that when I plug in a lamp, it works just fine? <Q> Actually, it sounds like your phase and neutral are swapped. <S> This is shown by seeing full voltage between neutral and ground but no voltage between phase and ground. <S> If you have non-grounded appliances, such as lamps, you will potentially have lethal voltage on the metal case. <S> I recommend calling an electrician immediately and not using the circuit until it has been checked. <A> What you have is a floating ground. <A> Let’s take the case that you are in a front of a wall socket and all cables are with the same colour: which is the live, which is the neutral and which is the ground connector?? <S> We assume that your circuit it is equipped with an ECLB (Earth Leakage Circuit Breaker). <S> -Recognize <S> the live conductor: the easiest way is to use the special screwdriver with a neon lamp. <S> Or try all the possible combinations with conductors with your AC voltmeter. <S> You will conclude with two conductor that your meter reads zero volt. <S> OK the remain conductor is the live. <S> -Recognize the earth and neutral conductors <S> : Use an appropriate tungsten lamp more than 60W. <S> Then connect one lead with the live and the other test the other two remain connectors. <S> The neutral conductor is the one that is no action by ECLB. <S> If ECLB acts this conductor is the earth and consequently the other is the neutral
Yes, this is a potentially lethal problem, and you should get it checked out and fixed by someone that knows what they're doing.
3.3V signals to a shift register IC with a 5V supply I have an SN74HC595N shift register that I want to have output 5V on the Q outputs. If I power it with 5V on VCC, can I tie the SER, SRCLK, etc. pins directly to the 3.3V digital outputs on my microcontroller? I wasn't sure if I needed a transistor between each microcontroller pin, or if the lower voltage would be acceptable directly to the IC. <Q> It is not guaranteed to work. <S> Edit: The margins are fine for 3.3V input, as alexan_e mentioned. <S> See below. <S> Note that you should not connect any outputs form the HC595 or HCT595 directly to the 3.3V circuit. <S> A simple single-transistor level shifter was discussed here : <S> If you use a MOSFET you don't need the base resistor, so it can be even simpler. <A> However, you can only add these pullups if your particular microcontroller has 5-volt-tolerant <S> I/O pins. <S> The \$V_{IH}\$ level for the '595 is too high for a 3.3V processor output, but adding pullup resistors may allow this to work for you. <S> I wouldn't recommend this for a production design, however. <S> Edit: I was assuming that you really had the HC version of the '595. <S> If you have the HCT version instead then please see the comment by @alexan_e instead. <A> I tested this last night to see what would happen. <S> Here was the set up I used. <S> 5 VDC from external power supply to bread board positive rail. <S> Ground from same power supply to negative rail. <S> NodeMCU Dev board 2.0 powered via USB cable (HiLetgo brand). <S> GPIO14 <S> (Pin 5) (3.3 VDC) to SN75HC595 SER <S> (PIN 14) <S> GPIO0 <S> (Pin 18) (3.3 VDC) to SN75HC595 ST_CP <S> (PIN 12) <S> GPIO2 <S> (Pin 17) (3.3 VDC) to SN75HC595 <S> SH_CP <S> (PIN 11) <S> SN74HC595 Connected to NodeMCU <S> (Listed above) VCC (PIN 16) to 5 VDC power rail <S> MR <S> (PIN 10) to 5 VDC power rail <S> OE <S> (PIN 13) to Ground rail GRD (PIN 8) to Ground rail Q0 though Q7 to positive legs of LEDs <S> (Resistors to ground.) <S> When pushing a simple loop (for int i = 0; i < 255; i++) the led output acted erratic. <S> LEDs would light up out of order and with different results than what the micro-controller was instructing it to do. <S> I then started pushing the same value with a 100 ms delay. <S> At first I was pushing the value 255 (b11111111). <S> All the LEDs stayed on. <S> I then switched to 0 <S> (b00000000) with a 100 ms delay. <S> Sometimes the lights would stay off, sometimes they would all come on, sometimes only a few would come on. <S> I'm not sure why the IC was reacting this way. <S> When I removed the 5 VDC power supply from the breadboard and used 3.3 VDC the Shift register, LED outputs acted as expected. <S> I got the proper results each time I latched the IC. <S> So the conclusion I came too was to use the same voltages for all inputs of the SN74HC595 shift register. <S> If you need to up the voltage of Q0 - Q7 do so after via level shifting. <S> I hope this helped.
You could use a level converter chip xx145 , or you could use a 74HCT595 , which will accept valid TTL levels at the inputs (and a 3.3V CMOS chip will give you that). You might be able to make this arrangement work just by adding pullup resistors from the '595 inputs to +5V.
PIC16F628A Resetting after relay turned off I am having problems with controlling a relay with load on it. I am using PIC16F628A. The problem is following: The relay has load. At first it is off. When the microcontroller's output is on, the relay turns on too. When the relay needs to be shut down, microcontroller's output is off. But when this happens, the microcontroller resets. EDIT: The load is 220AC. Trying to control bell. Please note that when there is no load, the relay command fully works, without resetting the microcontroller. Here are the schematics and the PCB from the project. P.S. The crystal footprint was changed to capacitor, because I need to draw footprint for crystal, but it has same hole dimensions as the capacitor. EDIT2: PCB Design was updated as suggested.The Updated Schematics & PCB: <Q> I had intended to only comment, but I found I had too much to say: Follow Spehro and Alexey's advice. <S> There are multiple issues here. <S> Perform all of the fixes, even if you find that just a snubber or decoupling capacitor seems to do the trick. <S> The load is 220AC. <S> Trying to control bell. <S> Please note that when there is no load, the relay command fully works, without resetting the microcontroller. <S> This would seem to indicate that switching the bell is the source of a spike causing the reset. <S> Do not omit the snubber &/or MOV that Spehro suggests since the relay is switching an inductive load. <S> I have seen too many problems with switched inductive loads causing resets in industrial equipment to consider the need for a snubber and/or MOV to be merely a "band-aid". <S> Besides the reset issue, without suppression of the spike, additional arcing will occur on the relay contacts shortening the life of the relay. <S> You can buy a snubber or make your own. <S> The added decoupling capacitor (suggested by Alexey) needs to have the shortest path possible to the PIC power/gnd pins. <S> The cut-up ground plane does not accomplish this. <S> The placement of the power/gnd pins on the PIC is a little difficult to accomplish a short path to the decoupling capacitor without either running traces between pads (could require longer-skinnier pads), or placing the decoupling capacitor on the back side. <S> You could "kludge" the decoupling capacitor to the existing board by cutting the leads short and either soldering it directly to the PIC power/gnd pins on top of the PIC, or soldering it to the pads on the solder-side of the board. <S> A few more unrelated comments regarding the board layout. <S> Since P1 and P2 are on 220VAC, isolate them to one area of the board with no other traces (even the gnd plane) even close. <S> See Creepage distance for PCBs handling line voltage AC? <S> ... <S> I would also not put the switches too near the AC since fingers will be in there. <S> Also consider adding some mounting holes to the board. <A> A better relay with high isolation (preferably with non-counterfeit European approvals), ground and Vcc polygon pours (you've got Altium, it's a very good and expensive program, you should use those features), and operating the relay from the unregulated input would all help. <S> PICs are pretty insensitive to mistreatment, but they're not magic. <S> You could try suppressing noise at the (presumably at least somewhat inductive) load using a snubber or MOV, but that's a band-aid and the problem will probably come back in some way. <A> Add capacitor 0.1u near pin 14.Pull up <S> PortA5 (pin4) to Vdd. <A> When I was a learner I had the same problem as you are facing now. <S> And I solved it after many failures. <S> The solution of your problem would be as follows: <S> First thing you have to do is to put a 0.1uF ceramic capacitor as near as possible to your microcontroller power pin. <S> This cap will remove all high frequency noise before it reaches the microcontroller. <S> If you are taking any input from external environment like sensor input, switch interface via long wire or any other input than unwanted high frequency noise will be introduced on wire or terminal when relay spark occurs or any other switching occurs. <S> You MUST remove it always otherwise reset problem will continue. <S> This will remove all noise from your circuit and it will function normally.
Your layout is not very good (in particular the Vcc path is long, thin and inductive), and that is about the worst relay you could choose (it is about the cheapest, however). This problem can be solved by putting a 0.1uF ceramic capacitor on each input pin with respect to ground before it reach at microcontroller pins.
Surface mount transformerless 230v to 3.3v on a small board I am trying to design a 3.3V mains power supply to go on a PCB approximately 50x25mm in size (this will include other functions too!). I've come across the Supertex SR086, which is almost perfect, except that it can only pump out 60mA, which is likely to be too little for my application (Atmel AVR, Nordic NRF24L01+, triac, MOSFET, zero crossing detection, possibility of powering an LCD from it). I would appreciate any suggestions or case studies for similar solutions. <Q> Consider the somewhat similar requirements the developers of the Belkin WEMO faced- tight quarters, reasonably high current low voltage supply required, mains input, WiFi communication, and an LED for an HMI. <S> Here <S> (Edit: Moved to here ) is a teardown of that unit. <S> You can see that the designers opted for a small switchmode power supply (and power output stage) on a separate board (probably two layer) from the high-density digital circuitry (probably multilayer). <S> That yellow mylar tape-wapped device on the left is a small switchmode power supply (flyback, almost surely) transformer. <S> Aside from being able to deliver the required current, providing safety-agency acceptable galvanic isolation at that point means that they can use inexpensive switches, and don't need to worry about electrocuting someone through a switch operator (or LCD in your case). <S> Judging from the small size, I'd guess they're using triple insulated wire rather than attempting to meet safety requirements by using tape. <S> Note also the extra insulation on the wires between the boards, for safety again. <A> The Supertex part also has a minimum recommended output voltage of 9V. <S> You will find it very difficult if not impossible to get more than 60mA of well regulated 3.3V without a transformer. <S> You will also not have galvanic isolation which can be a huge safety concern. <S> The Supertex part acts similarly to a lamp dimmer, turning on during only part of the AC cycle. <S> Even with a large output cap they have about 2V of ripple on the output at 100mA. <S> So this approach isn't really viable at 3.3V out. <S> A straight non-isolated buck converter is out because the duty cycle would be too small. <S> The transformer is probably a really good idea for safety and performance. <A> You should only use a transformerless power supply, if you can live without isolation. <S> Of course, this is only a possibility if this whole circuit is isolated from the external world properly. <S> If you really want a transformerless power supply, you should check out Power Integration's integrated PWM controllers. <S> There are nice buck converter design examples based on a single IC controller and some inductor, like these ones: DI-139 DER-45 <A> Laszlo mentioned the non-isolated offerings from Power Integrations and I'm going to mention the isolated type that includes a whole range of transformers from Premier Magnetics. <S> here is one offering that is a 5V dc output <S> but there are others that can be made to have a 3V3 output: <S> - There is also the slightly lower power linkswitch version with transformer: - <S> Again, premier make the transformer and PI make the chip.
A capacitive divider with post-regulation could maybe work, but the caps would be bigger than any transformer.
What is the function of the resistor in the below circuit? What is the function of the resistor R13 in this circuit? <Q> This is a pull up resistor. <S> When the switch is open, the resistor sets the MCLR pin at VCC. <S> Without the resistor the pin would be left floating. <S> The MCLR input is a logic input. <S> Which can be 0 or 1. <S> But in the real world, there is no such things as 0 or 1. <S> A convention could be defined: if the voltage is below Vcc/2 <S> it is considered as a 0. <S> If the voltage is above Vcc/2 it is considered as a 1. <S> A problem with this approach arise when the input voltage crosses the threshold. <S> At some point in time, it is at the threshold. <S> And if there is some noise on the signal, the pin could see a 0 or a 1 bouncing very quickly. <S> Imagine that the input is a clock signal and you would see clock edges where you don't want to. <S> The following approach solves that problem: <S> There is are two thresholds: Namely Vih and Vil. <S> A signal is considered as 0 if it is below Vil and a 1 if above Vih. <S> The two threshold are separated by a grey zone that prevent toggling by added noise (up to a certain level). <S> The following figure found on the web explains that feature: <S> The resistor in you schematics is here to make sure that, when the button in not pressed, the voltage at MCLR is above Vih (not in the forbidden region). <S> But, as @Spehro Pefhany expains in his answer, this is not enough. <S> A press button is not prefect. <S> When you release it, you may (and you will, actually) see bounces. <S> This picture, also found on the web shows this: A way to overcome this issue is to "smooth" the output signal using a capacitor as shown in the datasheet of the micro controller. <S> The capacitor would be quickly discharged through the low impedance path of the pressed button, but would take some time to charge though the resistor when the button is open due to bounces. <S> If you choose the right resistor-capacitor pair, you could make sure that it would take longer to the MCLR voltage to cross the Vil that it take to the button to stop bouncing. <A> This resistor is known as pull up resistor. <S> It is connected to the first pin of PIC for resetting. <S> When this pin is grounded or active low PIC get reset. <S> So for making IC in working mode, this pin is pulled up through this resistor. <S> A switch is used to ground the pin to reset the program. <A> From the PIC16F877 datasheet : In this case, the switch takes the place of the capacitor, to cause a reset whenever the switch is pressed (as opposed to only when the power is applied and the capacitor voltage is presumed to be about zero). <S> The upper limit to the value is the recommended 40K ohms (relatively high values will increase noise sensitivity as well). <S> The lower limit is set by how much current you want to draw out of the power supply when the switch is pressed. <S> A few K to 15 or 20 <S> K is a reasonable range for most purposes. <S> Note that when there is a capacitor, there should also be a series resistor, according to Microchip, of something like 1K or 2K. <S> It's not a bad idea to put it in there even with no capacitor (only a switch) because of possible ESD transmitted through the switch actuator. <A> There are several answers explaining how a pullup resistor works, so I won't go into that. <S> Instead I'll try to explain why it is there. <S> Pullup resistors are used when an input on a microcontroller needs to be controlled by several sources. <S> For example, in your case, SW1 can be pressed to reset the microcontroller by bringing its !MCLR/VPP line low. <S> What you don't show in your schematic is the programming interface from your programmer (e.g. ICD 3) which also needs to reset the microcontroller by bringing its !MCLR/VPP line low. <S> If MCLR was active high instead of low, then it would be possible for two inputs to be driving it at the same time, with slightly different voltages (for example, VCC from the switch and VPP from the programmer interface), and you could end up with all sorts of problems (especially if one input was at VCC and another at ground, creating a direct short. <S> Instead the devices driving the ! <S> MCLR line are configured as open-drain (or in the case of the switch, having it be an open-circuit until it is closed). <S> Open-drain outputs can be driven low, but cannot be driven high (the default high state is tri-stated, meaning it doesn't drive the line to VCC -- instead it looks like an input). <S> So any number of devices can be connected to an active-low line like this, and if more than one are driven low (ground), there are no problems . <S> However since none of these inputs are configured to drive the input high, the pull-up resistor provides the default high level (VCC), and it brought down to ground when any of the inputs go to ground. <A> Diagram is rather small; but that's a "pullup". <S> It brings ~MCLR up to logic 1, except when the button is pressed. <S> Replacing it with a wire would short out the circuit when the button was pressed. <A> when the switch is open. <S> You can reduce the resistance depending on current requirement for the ic. <S> When the switch is closed, the resistor is there to prevent Vcc from shorting to ground.
The resistor is there to limit the current going into that pin...
What reasons are there to avoid vertical through-hole resistors? I'm working on a layout for a PCB and I need to include a handful of pull-up resistors. The board I'm working on will be a proof of concept, and it is likely I will only need one (and order two). That being said, I'd like to keep the board area small. In addition, I'm using through-hole components to make any revisions easy. For these pull-up resistors, vertically mounting them would save some space and cost instead of alternatively mounting them horizontally. However, I rarely see vertically mounted resistors in commercial or industrial products. So, should I avoid using the vertical resistors even though they will save cost up front? Upon searching Google for an answer to my question, I came across these two links: http://www.head-fi.org/t/162556/any-reason-why-i-shouldnt-use-resistors-vertically http://www.proaudiodesignforum.com/forum/php/viewtopic.php?f=6&t=90 The consensus is that vertical resistors are less popular because: Auto-insertion machines can't (or don't prefer) vertical resistors. This isn't an issue for me since I'll be soldering the board myself. Horizontal mounting provides more stress relief. This is also no problem since my board will be safe in an enclosure that is only going to get light use to prove a concept. Are there any other reasons I am overlooking? Granted, most modern designs use SMT components that take up even less space. If the best answer to my particular situation is to just break down and learn to solder the SMT components, I would still like the background knowledge as to why the horizontal resistors are more popular. <Q> Mounting resistors vertically is something that you can find even in high-quality old equipment. <S> This photo shows the main PCB of a Fluke 27 DMM. <S> It was taken by Dave Jones of EEVBlog. <S> The date code on the ICs suggests it was made in 2004/5. <S> These were designed to for industrial use. <S> (e.g. in mines with potentially explosive atmospheres and by military forces) it seems that vertical mounting isn't necessarily unable to withstand a fair amount of vibration and shock. <S> I have a more than twenty year old ex-military Fluke 25 that carries many scars of rough usage and still works very well. <S> There are plenty of these around <S> so I don't think it's an exception. <S> Here's a photo of the main PCB in my Fluke 25. <S> (Date codes on the IC's suggest it was made in 1988, the PCB is marked 1984 design). <S> Not a lot changed in 17+ years. <A> Compare this with a resistor being mounted on the PCB flat against a flooded ground-plane. <S> The voltage pick-up level is proportional to frequency and area of loop formed by the resistor. <S> This is why surface-mount resistors are preferred a lot of the time. <S> Also, A high value resistor mounted vertically is also asking for trouble in the presence of HF electric fields - what you can create is a mini-antenna. <S> As for pull-ups and downs, surely you won't be swapping these out in your prototype - I'd consider using surface mount devices for these parts. <A> Vertical resistors are a bit messy and can short if they are pushed over. <S> In large quantities, vertical resistors are available preformed (bulk or in tape and reel or ammo pack), some even have the long lead dipped in lacquer (like the body) so they can't short as easily. <S> They're still pretty popular in the low end of production, and they can be stuffed by machine. <S> Photo here : <S> If vibration isn't an issue, there's really little reason why you shouldn't do this, with care to avoid possible shorting. <S> You could always sleeve the long lead if there looks to be an issue. <S> Keep in mind that in most cases you'll be far better off to use a surface mount resistor. <S> You can start with something huge like 0805 (or even 1206) until you get used to them. <S> Compare sizes here . <S> SMT resistors sizes <S> I gave above are based in measurements in mils (0805 is 80mils by 50mils or about 2mm x 1.27mm). <S> The metric equivalent of 0805 is 2012. <S> I would NOT suggest that you start with these new Rohm parts, which are metric 03015 ( <S> 0.3mm x 0.15mm). <S> Several million will fit in a 1" cube, and they are close to being an inhalation hazard. <A> To answer a question you didn't ask, if you need a few pullup resistors, you will probably save more space and time by using a resistor network such as shown here. <A> In my experience, vertical resistors are very common in cost-sensitive, hand-soldered products (in other words: cheap products from China). <S> So I think your are making a good decision when cost is a major concern. <S> But I am a bit surprised that PCB area is a major cost driver in a prototype, especially when there are only two TH resistors? <S> In my experience hand soldering a horizontal resistor is much easier because they tend not to fall out of the board when you flip the board over, so I prefer horizontal resistors, especially in prototypes!
Mounting a resistor vertically creates a bigger loop that can pick-up interference magnetically. For the same reason they're less resistant to vibration (for example they would probably be inappropriate in an automotive or aerospace application).
It is it possible to safely use a 110V variac (variable transformer) at 230V? I've come across a variable transformer/variac which is designed to be used with 110V input. Our line supply here is 230V. If I was careful not to exceed the VA rating of the transformer (920VA) would it be possible to safely use this with a 230V input? (I'd expect the output voltage to be twice of course, and I suppose replace the fuses with 1/2 current equivalents) It's something like this: <Q> No, the core will saturate and (if you're lucky) blow a fuse. <S> If your 230VAC happens to be (say) <S> 400Hz, the answer might be different. <S> Wikipedia has a very nice animated image showing the effect of too low frequency. <S> Too high voltage has the same effect. <S> The value of (maximum primary voltage)/frequency is a constant for a given transformer design). <S> As you can see, the magnetizing current spikes up twice per cycle and the resistive heating losses increase with the current squared. <A> so you might want to look "inside the case" and see if the Variac itself is indeed only 110VAC labeled, or of it's a 100-240VAC variac in a case that "makes it" 110VAC <S> due to connections and external labelling. <S> We used a lot of them to control high voltage supply outputs by controlling the input voltage of the supply back in the 1980s, so I've got some practical experience with them. <A> If you have a second one you can connect them in series for operating them without any issues. <S> Your output is between the middle connections. <S> You'll have 2 knobs for the voltage control. <S> If you change polarity in the connection you can have the knobs to turn in the same direction for gaining or reducing voltage. <S> And in such connection you have more possibilities for ac outputs: 0-230Vac output. <S> two 0-110V outputs, same phase. <S> one 0-110V output and one 180° phase shift output. <S> two 0-110V with 180° phase shift output. <S> :) <S> just a thought :)
While Sphero's answer rules if the device really is 110VAC input only, my experience with Variacs is that most of them are 240V friendly - to the point that they come packed with a dial that can be flipped to read correctly for 120VAC in or 240VAC in -
How to control the speed of a 12V DC motor with an Arduino? I'm trying to figure out how to control the speed of a 12V DC motor with an arduino and a 12V battery. I want to split the «power» and «control» parts of the circuit so the Arduino and sensors receive only 5V. So far, this is what I've tried : I am able to control the speed of the motor by changing the PWM of pin 3 on the Arduino. This opens the NPN transistor ( BUF654 ). The problem is that the speed of the motor doesn't change enough. From 0% to 50% PWM on pin 3, the motor is stalled. Above 50%, the motor is nearly reaching its maximum speed. I wonder if I would be able to have a linear variation : 0% - 10% : very slow10% - 20% : slow20% - 50% : normal speed50% - 80% : fast80% - 100% : RELEASE THE KRAKEN! Here are the voltage and current the motor draws when using only a battery, or the previous circuit : +----------------------------+---------+--------+| Directly on 12V battery | 12.7 V | 61 mA |+----------------------------+---------+--------+| Arduino circuit (100% PWM) | 12.47 V | 60 mA |+----------------------------+---------+--------+| Directly on 9V battery | 9 V | 54 mA |+----------------------------+---------+--------+| Arduino circuit (60% PWM) | 9 V | 52 mA |+----------------------------+---------+--------+ What have I done wrong? Could the problem come from my motor? <Q> Your diode is in the wrong position- <S> it should be across the motor (blocking!) <S> not across the transistor. <S> The purpose of the diode is to allow current that is flowing in the motor coil to continue to flow in the same direction when the transistor turns off. <S> When the transistor turns off, the voltage at the transistor collector will rise as it was flowing out of the motor. <S> From \$V_{CE(SAT)}\$ it will rise above the power supply voltage and stop only when the transistor breaks down (or when it starts to ring with parasitic capacitance). <S> By putting a diode from the transistor collector to the +12V rail, you prevent the voltage across the transistor from exceeding 12V and and allow the motor current to continue to flow. <S> The way you have the diode in your pictorial <S> , it would only conduct were the voltage to go below ground. <S> That could only happen if someone mechanically spun the motor very fast in the reverse direction (and your diode would cause the voltage on the 12V rail to increase as a result). <A> Albeit the diode is in an unusual position, the circuit works well. <S> Usually the diode is placed across the inductive load - i.e. across the motor pins - very close to the motor (if you use long wires, this is important). <S> This helps to suppress electric spikes generated by the motor when you stop it <S> but it keeps rotating and acts as a generator for a very short fraction of time. <S> These spikes can kill your transistor. <S> The other solution - what you have done - is to protect the transistor itself. <S> You shall note that it is impossible to make a DC motor turn very slowly. <S> This comes from the mechanical structure of the motor. <S> If you're using a motor without gear reduction, you'll see that 30%-100% pwm makes some difference, while 0..30% does nothing. <S> With geared motor (the gears are extra load), you may need go to to 50% just to make it start. <S> You can do a few things: <S> use the map function to map your 0..100% power needs to 50..80% of PWM output. <S> Note that the speed is not always linear to the pwm input, so you may need a linerization table to fix that. <S> if your goal is to have a motor which can rotate extremelly slow, consider using a stepper motor. <S> If you need extremelly slow and mid range, this is good. <S> If you need from extremelly slow to extremelly fast, you'll better go with two motors, and a differential gearbox, if you're good at mechanics <S> Another solution is to use a three phase AC motor and drive that with the microcontroller. <S> This solution is not a beginners' topic, but this is the de-facto solution for todays electric vehicles. <S> The trick is that the motor windings are always energized, therefore you have a constant torque. <S> While changing the frequency of the driving waveform, you have a very precise control over speed. <A> Could it be static friction? <S> What happens if your arduino sketch first starts the motor (maximum PWM) and then slowly decreases over several seconds?
My experience is that it's very hard to run a DC motor slowly (unless you have position feedback of course, or gears).
Switch poles from inverted power to make negative positive? My understanding is that voltage is relative (where you measure affects voltage) and that current flows with voltage difference. Why can't you just switch the poles/wires of an inverted signal/power supply to get a non-inverted output? This is mostly in reference to power supplies (switching/voltage regulators) and op-amps, but sort of curious as to theory as well. <Q> That is fine so long as the signal/power is isolated from the common reference/ground. <S> The problem is that generally, one side of everything is connected to a common reference/ground. <S> For example, on an ATX power supply, the negative side of +12V, +5V, <S> +3.3V are all connected together on the black wires. <S> If you try to reverse the +5V rail, for example, you will end up shorting out that rail. <S> If you have a signal or power source that does not reference the common ground, you can easily invert it as you suggest. <S> The problem is that it is often harder or more expansive to have these isolated. <A> If the output of a power supply is isolated , meaning it can float over a range of voltage relative to its input, then the polarity of its output is only relative. <S> Whether it is a positive or negative supply is only determined by how you think of it and how you hook it up to your load relative to whatever it is <S> you consider 0 V. <S> If a power supply is not isolated, then it is already referenced to some other voltage. <S> If your load is also connected back to that node somehow, then you can't just flip the leads of the DC output around. <S> For example, you might have a 5 V power supply that runs off of the battery in your car. <S> If it is not isolated, the negative output of that supply will most likely be connected to the negative output of the battery, which is connected to the chassis of your car. <S> If you are powering something that also connects to the chassis, then you can't flip the leads around and think of it as a -5 V supply. <S> On the other hand, if you have a power supply that plugs into the wall, most likely its outputs are isolated from the wall power and therefore the wall plug ground. <S> In that case you can flip the leads around any way you wish to consider it a positive or negative supply. <A> You can treat negative as ground and therefore your positive is positive with respect to ground (obvious!). <S> Or you can tie positive to ground and your negative rail becomes a negative supply. <S> It doesn't really matter at the end of the day <S> but when it comes to signals (such as audio for instance), they like to be referenced to real ground <S> so having a negative power supply voltage makes things a little tricker because most audio amps like to see a positive supply with respect to ground and ground is assumed to be the most negative rail in a power supply. <S> Same with a lot of power supply chips - most smpsu chips are positive supply devices (with respect to ground) but with a little bit of ingenuity can be made to work with a negative supply voltage.
In fact, using an isolated DC-DC regulator, it is common to swap the output leads to get negative voltage.
What happens when plates of a fully charged capacitor are isolated from each other? I'm a mechanical engineering student and I'm working on a project that involves a high voltage capacitor. I understand that when the separation between the plates of a charged capacitor is increased, the voltage increases. But I'd really like to know what happens to the plates if the capacitor is fully charged , disconnected from the charging circuit and then the plates are moved apart from each other by an infinite distance. Will each plate remain charged? <Q> Charge = capacitance x voltage <S> (\$Q=C\cdot V\$) <S> so, if distance increases (and capacitance falls) then voltage increases proportionally. <S> If the plates are taken to an infinite distance, the voltage becomes infinite. <S> It should be noted that the energy "held" in the capacitor increases as the plates are pulled apart i.e. Energy = \$\dfrac{CV^2}{2}\$ <S> The increase in energy comes about because work (joules) has to be done to move the plates physically apart <S> i.e. there is a force needed to open up the gap. <S> This, I believe keeps all the conservation of energy and charge equations happy and smiling. <S> Remember, that on a regular capacitor, there is an attractive force between the two oppositely charged plates and it is this force that is trying to stop the plates from being pulled-apart. <S> If the capacitor plates remain connected to the supply, as the distance increases the voltage must stay the same so therefore charge is reduced (because C reduces) and this pushes current back into the power source. <A> Infinities can be tricky. <S> The force between two charged particles varies inversely with the square of the distance between them. <S> The energy required to increase the distance between two oppositely-charged particles from d 1 to d 2 is the integral of the force over that path. <S> Even if d 2 is infinite, this integral has a finite value. <S> This result generalizes to large collections of charges on, say, the plates of a capacitor. <S> What this means in terms of your question is that the capacitance of the two plates does not actually tend toward zero as they are moved apart, and the voltage does not go to infinity. <S> One way to interpret this result is to say that each plate individually has some minimum value of capacitance to the universe "at large". <S> It may help to visualize this not as two parallel plates, but rather as two concentric spheres, and allow the outer sphere to grow to infinite radius. <S> It may also help to draw the analogy with gravity, which is another inverse-squared force. <S> An object falling to the surface of the Earth, even from infinitely far away, has a finite amount of energy (and a finite velocity) when it arrives. <A> Keep in mind that the charge doesn't necessarily remain on the plates. <S> Especially charging a Leyden jar to high voltage, the charges will jump the air gap between the foil and jar to sit directly on the dielectric surface. <S> You can remove the plates, but the charge remains with the jar. <S> Here's a good demonstration <S> https://www.youtube.com/watch?v=9ckpQW9sdUg <S> But you could accomplish the original thought experiment by using a double layer dielectric. <S> Construct a capacitor out of two pieces of foil, with two sheets of plastic between them. <S> Then charge it up to high voltage, remove the foil, and the plastic sheets will remain stuck together. <S> Then peel the plastic sheets apart, and in a perfect insulating medium they should remain fully charged. <S> In air, their surface charge density would be too high and bleed some off as soon as they're separated, down to the 26.55 microcoulombs per square meter limit <S> http://www.coe.ufrj.br/~acmq/efield.html ... <S> though that's still enough to stick a balloon to the ceiling :) <A> Charge will stay on a capacitor's plates unless that charge can be carried elsewhere. <S> If the charged plates are isolated, then pulled apart in a vacuum, they'd keep their charge indefinitely. <S> Dust, humidity, air itself, can all carry off that nonzero charge. <S> Like charges repel, so they spread out over the surface of a conductor. <S> The plate or plate assembly wouldn't really be pushed apart until we're talking incredibly dense charges. <S> Even then, I'd expect to capture dust, ionize the air, or shed "conductor" atoms one at a time rather than cause the plate to fall apart on any more macroscopic scale.
If the capacitor has a voltage across its plates and the supply is disconnected, the charge remains irrespective of the distance
How do the streetcars in Toronto draw power from the lines? I've tried googling this but to no avail. I've been trying to figure out how streetcars can draw power from a short circuit. For reference: (source: roadstories.ca ) If I imagine the power lines simplified as a shorted battery like so and we assume the streetcar acts like a resistor like so Would it not just reduce back to the first diagram with the short circuit? <Q> Power feeds in from the overhead wire and connects to a pantograph pick-up on the roof. <S> This routes the power through to a controller and then to the motor and the return path for current travels along the rails: - I used to remember a thing called a trolley bus in my home town when I was a kid - it was a regular bus with rubber wheels but had a double overhead cable pick-up - positive (it was a dc feed) was on one wire and negative <S> (return) on the other. <S> Ye olde trolley bus: - <A> Obviously the power lines are not like a shorted battery, as no meaningful power could be drawn if all of it is being 'burned' into a short circuit, so to speak. <S> Therefore, since streetcars are able to draw power and run, the distribution system cannot be a short circuit. <S> If there are no streetcars on a line, it's essentially an open circuit - each streetcar is a load, and multiple streetcars on a line are loads in parallel. <S> Wikipedia explains the concept of a trolley pole very simply: <S> I'm confident that an actual short circuit would trip a protection device at the DC distribution source and disconnect the line, leaving it unpowered until the fault was corrected. <S> (Aside: there are 52 substations providing DC power to Toronto transit vehicles) <A> The overhead lines carry +600VDC (isolated into regions that are supplied by individual traction power substations). <S> Return current is through the rails, which are held at a voltage close to earth potential. <S> The streetcar appears as a load from the wires (through the trolley pole) to the rails. <S> See, for example: http://www.vivanext.com/files/EnvironmentalAssessments/YongeExtension/Conceptual%20Design%20Report/3277670%20Conceptual%20Design%20Report%20Appendix%20C.pdf <A> Just to close this answer circuit (ahem), this is the reason why streetcars can use a single pickup pole (or trolley), but trolley-buses must have a dual pole. <S> That's because trolley-buses run on rubber tires with no track and aren't grounded the way a steel car with a metal wheel on a metal rail is grounded. <S> If not for a second pole on a trolley-bus pickup, any passenger who, in stepping off comes into simultaneous contact with the trolley-bus (aka trolley coach) body and the ground will have the power routed through his body! <S> Dead passenger! <S> Anytime you see a photo of a trolley-bus or trolley coach, it will have two poles, or else some photographic fakery is invovled. <S> - al smalling, chicago
When used on a trolley car or tram, i.e., a railway vehicle, a single trolley pole usually collects current from the overhead wire , and the steel rails on the tracks act as the electrical return.
Is PWM bound to a certain voltage? I have been working mostly with 5V rated MCU but I am venturing into the world of 3.3V rated MCU's. That should not effect PWM,right? (PWM is bound to time, not voltage as I understand it) Any info would be appreciated. Thanks. <Q> The voltage of the PWM output pulses will depend on the processor's supply voltage. <S> A processor operating on 3.3 volts can't produce a 5 volt output pulse. <A> As such, it only requires a output that can encode two discrete steps. <S> This output can be translated from one signaling format to another with no theoretical losses. <S> 0V-5V is one common format, as is 0V-3.3V, and 0V-\$_{n}\$V, and more exotic current-mode mechanisms. <S> However, translating from one signaling mechanism to another is possible with little effort, just requiring the use of the proper buffering device, so no single PWM physical coding mechanism is limited to that mechanism by anything other then the costs of the parts required to perform the level/mode translation. <S> So the answer to your question, on the face of it, is no. <A> PWM is bound to time and not to amplitude other than it should have distinguishable and stable voltage or current levels. <A> It depends on what you do with the generated PWM. <S> If you use the PWM to a device that reacts to the duty cycle of the PWM then the result will be the same (assuming it accepts 3.3v input). <S> On the other hand if you use the PWM to generate an analog voltage <S> then the result of a 5v PWM will be different compared to a 3v PWM. <S> Of course in that case you can always use an amplifier stage to increase the PWM level to any level you want.
The PWM is a discrete-value output that is modulated in time.
Why is MSP430's Stack Poniter(SP) always alligned to even address? While I was reading through the MSP430's User's guide, I came to know that its stack pointer is alligned to even address. (Read Pg.189 of http://www.ti.com/lit/ug/slau208m/slau208m.pdf ) Why is it so ? Why is the stack pointer alligned to even address? As per my understanding, each address location in RAM can store 16bits of data irrespective of even or off address location. From the below image it is clear how that data can be pushed or popped in RAM. Now it is like each address(even or odd) can store 8 bits of data. But I expected each address can store 16bits of data. <Q> The msp430 is natively 16 bit. <S> It has a 16 bit, 2 byte bus. <S> Memory addresses are still numbered in 8 bit, 1 byte increments, as this is the standard for memory addressing. <S> This is why the stack is evenly aligned. <A> As per my understanding, each address location in RAM can store 16bits of data <S> No, each RAM address stores 8 Bits of data, or one Byte. <A> Each memory address references a single byte, but the internal data bus (and flash memory) of the processor is 16 bits wide. <S> When accessing values in memory that will be used for data, this is irrelevant from a hardware perspective; it's something the compiler will deal with. <S> When accessing values in memory that will be executed, i.e. are machine code instructions, the processor has to make sure that the instructions are always aligned to an even-numbered byte address. <S> It does this by enforcing a constraint on the PC (Program Counter) <S> register that it must always be even <S> (bit 0 of the PC probably isn't actually implemented as a DFF at all, just hardwired to logic 0). <S> If the instruction was on an odd byte address, it would be half in one memory location and half in another. <S> The processor would need to be considerably more complex to deal with that possibility; it's simpler (and, ultimately, cheaper) for the processor designer/manufacturer to accept the tradeoff of less complexity in exchange for the processor only being able to deal with even addresses for instructions.
Instructions have to be on even byte addresses because the processor has to be able to read the entire instruction in a single operation from a single 16-bit wide memory location.
Could this white paste be the cause of intermittent power in a Dell LCD board? I took apart my Dell 17" to try to repair it. I expected a burned out capacitor or something else obvious but the only thing I found was this white paste touching several components. Could this be the cause of the problems or is it generally non-conducting? <Q> What you have there is the dreaded BenQ-designed CCFL inverter design that permeated all 17-19" TFTs in the mid-00's. <S> You will likely find many more of the exact same failures in almost all brands of CCFL-backlit displays of that era, because with very few exceptions all commodity displays used the same CCFL inverter design. <S> Then they reused the design for 17 and 19 inch displays at higher brightnesses, driving the transistors beyond their design limits. <S> This caused them to overheat (you will see a bit of scorching near those transistors) and eventually fail. <S> These capacitors would get higher ESR which caused the primary power stage to ripple more and exaggerate the overloading of the 2SC5707 transistors. <S> These problems are technically unrelated, but one often leads to the other. <S> I can't really read your brand and type of capacitor from the photos, but at first glance they look like quality brand and my experience with Dell monitors <S> is that they usually replace the default BenQ choice with better caps. <S> That means that the repair is probably as easy as getting a couple 2SC5707's from eBay and replacing them on the board. <S> The fundamental problem still persists though, and it is advisable to improve the heat dissipation capacity of the transistors by e.g. attaching a bit of copper clad board on the flange. <A> No. <S> This is a silicone adhesive used to ensure that large capacitors do not break off from the board due to vibrations. <S> It is non-conductive and widely used in industry for DIP components. <S> Look for shorts or capacitors that look like they have leaked something out. <S> If you have a multi-meter begin by checking that the power supplies are correct. <S> Also try cleaning the dust off, sometimes it can be the cause of problems. <A> That white gunk you see is sometimes a silicone material as Gonzik has suggested. <S> You can generally tell if it is silicon if it has retained a rubbery texture. <S> However note that many far east manufacturers use other types of materials that can get very hard after some years. <S> There are other types that are a nasty yellow color that sometimes contain chemicals that have been known to slowly eat away copper traces on a circuit board or interact with the seals on the bottoms of electrolytic capacitors turning it into a gooey black mush.
The problem was compounded by a bad default choice of capacitors, which are often faulty as well. This white gunk is generally OK. The biggest problem with this design is that BenQ designed in freestanding 2SC5707 transistors for the (bipolar) power switching, which are designed for 9-W (peak) 15" display backlights.
Digital logic input with very wide input voltage range We are developing an industrial controls product that will be used to monitor the presence or absence of voltage ranging from 5V to 480V. Since the unit will be generic and programmable, this input may be used in a variety of unpredictable ways. The problem I have been wrestling with is how to monitor such a wide range of voltages with a single circuit design. For example, if I drive an optocoupler LED directly, I can't get the 5V to turn it on without the 480V destroying it. Voltage regulators typically operate on much lower voltage than 480V, so I'm in a bit of a dilemma. The industrial controls solutions I've seen get around this problem by saying, "purchase this other model for high voltage input" or "buy this high voltage input converter and add it on." Is that really the only solution here? Am I trying to do the impossible? Any input would be appreciated, no pun intended ! A possibly related question <Q> You should be able to do this if you think of this input voltage as a analog signal. <S> Attenuate it <S> by 100, <S> and you have something in the 0-5 V range. <S> 5 V in results in only 50 mV, but that is still plenty high enough to detect above any reasonable noise floor. <S> With such a 100:1 range, I expect it's not as simple as just checking whether it's over 4 V, for example, or not. <S> The code can hopefully check what the expected level is, perhaps see that it is fairly steady, or whatever. <S> Keep in mind that a line that is at 480 V when "on", might have more than 5 V of noise on it when off. <S> I think some logic that does more than just a dumb fixed threshold comparison will be useful. <S> Due to the high voltage, you want to use a high impedance divider else it will dissipate significant power. <S> 1 MΩ top resistor and 10 kΩ bottom resistor sounds like it might work. <S> That's not quite 1/4 W at 480 V in, and of course much less at lower voltages. <S> It also provides 10 kΩ impedance output to drive the A/D input with. <A> The voltage divider R1,R3 needs to create approximately the threshold voltage of the Nmos which is usually around 0.7V when the input is 5V. <S> The Zener diode is there to protect the Nmos gate so anything above the chosen Zener voltage just gets dropped straight to ground. <S> This allows a very broad input range. <S> R1 needs to have about 1Mohm or higher resistance to prevent too much current flow on the input side. <S> The output is a simple common-source inverting amplifier output. <S> R2 should be matched to whatever output current you desire, i.e. Vdd/R2= <S> I. Make sure Vdd is NOT the same as your input signal. <S> It should be at a level that M1 can handle. <S> The way this circuit works is between 0-5 Volts <S> the voltage divider should not provide a voltage high enough to reach the threshold voltage of the Nmos. <S> Above 5 volts the threshold voltage is reached, the nmos turns on and drives the output to ground. <S> If the input gets really high and the voltage divider starts passing through too high of a voltage, the Zener diode "kicks in" and limits the input voltage to, in this case 5V max. <S> The 5V threshold isn't terribly accurate as threshold voltages on mosfets are prone to vary depending on the process that made them. <S> If greater accuracy is needed, I'd head towards an op-amp solution unless the digital solutions mentioned in the other answers work as well. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> I think your voltage range will be hard to achieve with one circuit. <S> I have made industrial inputs that were robust for inputs in the range of 0 to about 50V. <S> I used an optocoupler LED as the input. <S> Instead of using a resistor to bias the optocoupler I used a current regulator diode in front of the LED which leads to linear increase of power dissipation in the bias component as voltage increases instead of a squared increase like you get with a resistor. <S> I've used a slightly different strategy for sensing high voltages with an optocoupler. <S> I'll post the circuit of that shortly. <A> so thought I would share my findings: <S> I used a rectifier into several current limiting diodes in series to control an opto-isolator. <S> The Semitec E-202 passes 0.5-2 mA across a voltage range of 0.5 to 100V. Six E-202s in series into a Vishay SFH618 Opto should pass 0.5 mA fairly easily (assuming something like 3.3V or 5V available for opto supply). <S> There isn't a ton of wiggle room and your output signal will be fairly small, but you'll have very good isolation and reliable sensing of presence/absence of voltage between about 4.5V and 600V <S> (remember 480 Vrms gives you 580Vdc out of the rectifier). <A> TI has a quite a good solution that can help you sense up to 350V DC. <S> The idea is to limit current by a resistor and additonal current limiting circuitry: Interfacing high-voltage applications to low-power controllers
Current limiting/regulating diodes are great, I tackled a similar problem a while ago It might be a good idea to run this into a micro to actually measure the voltage, then have the code decide whether the input voltage is really "present" or not.
Is impedance matching a requirement for CAT-5e traces? I'm building a patch-board for CAT-5e cables, whereby any pin can be re-wired to any other by a set of jumper cables. This is for testing black-box systems where weird things have been done to Ethernet sockets in order to make it difficult for someone to just walk up and plug in a laptop. I'm in the PCB design phase, and have the following design in mind: Here's the design I have in mind: The board is using 0.254mm traces, and the total length of each trace is no more than 25mm. I've alternated the traces on each side of the board to increase clearance between them, and hopefully the PCB itself should provide a little insulation against EM leakage. I'd like to know if impedance matching is going to be an issue on a standard 10/100 Ethernet link, across this kind of design. Obviously the outer traces are currently about 50% longer than the middle one. Any other recommendations on improving the design would also be welcome. <Q> About trace length matching: IEEE 802.3 specifies propagation delay and not distance (see 23.6.2.4 Delay from IEEE standard section 2).It says that you should have a maximum propagation delay of 570ns for your entire link and also propagation speed per meter should not exceed 5.7ns/m (thus the 100 meter common "limit"). <S> But you are not concerned by these specs (just a reminder <S> , in case you have a long link). <S> 23.6.2.4.3 Difference in link delays <S> The difference in propagation delay, or skew, under all conditions, between the fastest and the slowest simplex link segment in a link segment shall not exceed 50 ns at all frequencies between 2.0 MHz and 12.5 MHz. <S> It is a further functional requirement that, once installed, the skew between all pair combinations due to environmental conditions shall not vary more than ± 10 ns, within the above requirement. <S> You should retain that the maximum skew allowed on your whole link is around 10% of the maximum propagation delay (570 ns). <S> As you are designing a custom adapter, we will take large margins to simplify computations and consider your adapter is equivalent to 1 meter of link. <S> So the maximum propagation delay allowed for your segment is 1/100 of 570ns = 5.7ns. <S> The allowed skew between pairs is 1/100 of 50 ns = 500 ps. <S> Given your routing specs, the propagation delay of the signal is around 50 ps/cm. <S> So with a 500 ps allowed skew delay, you can have a length difference of 10 cm. <S> No worries here. <S> Also, about EM leakage, 100 Mbits Ethernet signal frequency is 12.5 MHz, <S> even if it is rise time equivalent frequency that matters, you don't have to worry to much if you are following advices given here by Dzarda and dextorb <A> Your trace impedance will be mainly controlled by your board stack-up parameters, not, interestingly enough, the trace length. <S> If you're interested, play around with a PCB calculator for a bit. <S> Saturn PCB Design, Inc. provides a nice toolkit . <S> You will need to know some parameters of your stack-up in order to calculate your differential impedance. <S> Take notice there is a tolerance window; it doesn't have to be exact. <S> How aggressive you want to be depends on the application. <S> In some situations, perhaps you can get away with +/-20%, and maybe sometimes you can't. <S> Also, you'll want to route the RX+/- and <S> TX+/- pairs together, on the same layer, as they are differential pairs. <S> Length-matching, while related to signal integrity, is a different matter. <S> Just keep the traces short like you have and you will be fine. <A> I wouldn't worry about it too much. <S> Of course there are standards saying that you need to maintain \$100\Omega\$ differential impedance, also to keep your differential pairs length-matched to 50 mils, etc... <S> Just a tip: <S> I'd stick with 45 <S> ° turns. <S> Or if you need to get fancy, you can use round corners. <S> If you require as much reliability as you can get, match your lengths using meanders
You will want to target a \$Z_{diff}\$ (differential impedance) of 100Ω for Ethernet.
MCLK in I2S audio protocol I am working with the I2S audio protocol in one of my projects and I'd like to use it in one of my final projects for a class of mine. Quite honestly though, I don't entirely understand the MCLK line. You'd think, "Oh that just stands for Master Clock" and you might be right but since everything has to do with audio and sampling rates, I get confused. I'm using the CS42436 in software mode: in short it takes in 3 signals (that I'm questioning). MCLK - Master Clock (Input) - Clock source for the delta-sigma modulators and digital filters. SCLK - Serial Clock (Input) - Serial clock for the serial audio interface. Input frequency must be 256 x Fs FS - Frame Sync (Input) - Signals the start of a new TDM frame in the TDM digital interface format. Can somebody explain how to use these clock signals in reference to this picture? I know the middle signal is the serial clock, but the other two I don't understand at all. <Q> The top signal is Frame Sync (FS). <S> FS is used to indicate whether the audio is for the left or right channels. <S> Don't think of them as "left" and "right" though, those are just arbitrary names. <S> Think of them as channel 0 (FS clear) and channel 1 (FS set) <S> , time-division multiplexed onto a single communications link. <S> The bottom signal is the serial data that is being clocked into(?) <S> your MCU. <S> MCLK is not visible in that diagram. <S> It is the clock that is used by the audio codec (in your case, a CS42436) to time and/or drive its own internal operation. <S> It is a relatively high frequency; a common value is 256*Fs (where Fs is the sample rate, e.g. 44.1kHz). <S> Values in the range of 10-60MHz are pretty typical. <A> Serial clock is not 256 <S> * <S> Fs,Serial clock is your sampling freq (Fs <S> ) * # of <S> bits / channel * # <S> of channels.for ex, <S> 2 channels for Stereo and 1 channel for Mono. <A> It can be derived by a Crystal connected to the DAC (i2s-master). <S> Or, it may be the CPU providing a MCLK to the DAC, that is still master. <A> Frame Sync or LR (left Right channel) clock or generally called word sync, which is the sample rate you are playing or capturing the audio files. <S> Bit clock or called I2S clock which derived by Frame Sync * <S> no.of <S> channel (in I2S it 2 , ie L and R) and no.of bits per channel (depends on the sampling format 8, 16, 32 bit modes) <S> This is real sampled PCM data to record or play over I2S data lines (either in or out). <S> Master clock (Mclk): <S> Mlck is derived from LRCK and SCK when operating in Master mode (For synchronising internal peration of audio codec). <S> This can be enabled/disabled in slave mode also (When master is not able to give mclk).
The Master clock generates the timing of the i2s stream, so bitclock and frame sync signals are derived from it.
A subsystem with randomised outputs (no microcontrollers) I'm trying to make a subsystem that has several outputs. By default, all outputs are 0. When turned on, I want it to randomly set one output to 1, and make it stay at 1 until reset (the reset procedure can be anything, but is preferably a pulse). I'm a bit of a newbie at electronics, but I know all of the basics. Apart from the basic components, I have access to 555s and most of the 4000 series. Preferably, I would like to avoid the use of a microcontroller. <Q> Four possibilities spring to mind: <S> Your idea of an astable connected to a 4017, might just work, if you use A trigger pulse of 1000 or more times the period of the astable oscillator (possibly using a 555 monostable to extend the existing trigger pulse) <S> A thermistor, governing either the frequency of the astable oscillation, or the length of the trigger pulse. <S> In this case, the tiny random heating/cooling of the thermistor by air currents may be sufficient to produce a random result. <S> If this doesn't work, a microcontroller is the easiest option (this is probably true even if you have no experience with microcontrollers). <S> The kind of algorithm that would be implemented inside a microcontroller can be built out of 4000 series logic, but it would not be entirely straightforward. <S> With a handful of shift registers and XOR gates you can build a linear feedback shift register (LFSR), which produces a pseudo-random bitstream. <S> You could demultiplex a few bits of the shift registers to enable one of N outputs (easiest if N is a power of two). <S> You may need to clock the LFSR more than once per output, to avoid strong correlations in the random output. <A> Make a simple one transistor AM radio or FM radio such as described here (or use the output of a commercial one) and tune it between stations to generate static, your random source. <S> (I assume your location will be fixed, so you can find a reliable spot between local stations.) <S> Feed the output normally going into the speaker into a comparator and set it up so the comparator triggers on the peaks coming from the radio. <S> When the radio is turned on, start a timer on detecting the first peak. <S> During the time period, count the outputs from the comparator. <S> Use those to feed a counter. <S> When the timer stops, stop counting and use the counter value to select your 1 of N outputs. <S> You will need to experimentally adjust the timer to get the number of peaks averaging half the value of your counter. <A> I'm not entirely certain how comfortable you are with electronics. <S> Here's something I came across a long time ago when I was trying to do something very similar <S> (I'm not certain how I ended up doing it though, to be honest.) <S> http://www.ciphersbyritter.com/RES/RNGMACH.HTM <S> It's in some sense a summary of a series of possible solutions/discussons published in peer reviewed journals between 1955 and 1996. <S> The later ones include crude schematics as well and could possibly be reproduced. <S> The link has been valid atleast since 2007. <S> In case in the distant future it disappears, the Internet Archive or the Way Back Machine or one of those services probably will have a cached copy.
If you actually need a genuine source of randomness, one low-cost option is to use transistor avalanche breakdown noise to generate a random bitstream, and then use a shift register and demultiplexer again to generate the random one-of-N output.
Video stream over RF I want to stream video from a camera 640x480 frame of 8-bit approximately. I don't want to use wi-fi. I capture the data, encode it, transmit the signal over RF and receive it. Decode the signal. My goal is to make a quadcopter streaming live video over radio frequencies. How is this achievable? I am in my final year of electrical engineering in telecommunication. <Q> You state frame size and resolution per pixel but no refresh rate. <S> Assuming one frame per second, the data rate is: - 640 x 480 x 8 bits per second = 2.4576Mbps. <S> There are no cheap off-the-shelf solutions for this (even at one frame per second). <S> For instance Zigbee will work up to 250kbps. <S> Nordic NRF24L01G is good for 2Mbps and you might get 20 metres at this bandwidth and operating frequency but remember it only produces an output power of 1mW. <S> The best option you have is to compress the data using something like MPEG methods - this could reduce your streaming data rate by a factor of ten and then you have a chance of getting something off the shelf. <A> Not the easiest thing to do I'm afraid. <S> There are several Video over RF solutions available. <S> None of them that I could find are very open, however. <S> The Ham community has been transmitting video since near the dawn of television. <S> There's two kinds of television transmission, SSTV(Slow Scan TV and FSAT(Fast Scan Amateur Television). <S> You might be able to find some schematics online. <S> Different places will sell transmitters and receivers. <S> Try searchging google for fpv video, atv video, and fpv piloting. <S> You'll turn up some stuff. <A> If you want to go digial, Analog Devices makes a few chips that might help you, such as the ADV212 video compressor. <S> It goes for about $40 but as a student you might get away with sampling one. <S> Unforunately, it's only available in BGA packages, so your fabrication won't be trivial <S> - you'll need a multi-layer PCB and the ability to solder to it. <S> You might be best served by going analog. <S> RGB to NTSC converters like the Motorola (now Freescale) MC1377 are widely avaiable. <S> You can form a baseband from this signal using this scheme and then upconvert it with a mixer into the analog TV band. <S> If you have an amateur radio license, there are frequencies set aside specifically for this purpose. <S> Once you do this, you can view the video signal with a plain old tube TV tuned to the right station. <S> As an added benefit, if you have a poor SNR the signal just gets fuzzy rather than completely blacking out without warning in a digital system. <S> EDIT: another thought on the digital front - you could probably do MPEG or other video compression on a Digital Signal Processor like the Analog Devices Blackfin . <S> ADI already provides a software library for MPEG4 . <S> This should cut down your bandwidth requirement considerably.
The FPV community in the RC plane and quadcopter community sells several kits that will do this for you. It's really a question of the necessary bandwidth, which is restricted based on the frequencies regulated in your area, and the encoding scheme used for the video.
How is the clock frequency established between master and slave in I2C protocol? This is a follow-up question to What happens if I omit the pullup resistors on I2C lines? In a digital wall clock I designed (using the DS1307 RTC and the ATmega328 MCU), I accidentally omitted the pull-up resistors that must be wired to both I2C lines. In the end I was lucky enough that the internal pull-ups on the ATmega I2C lines were enough to (barely) allow the communication between the devices. The result were long rise times on the I2C lines and speed reduction to 32kHz as seen in the scope shots below. Edit: Actually, the frequency is exactly 100kHz - there are 2 peaks per 20us on the green trace. I initially thought there was a reduction to 32kHz because my scope calculated the frequency on the yellow trace. What's puzzling me now is how the devices decided that 32kHz was enough for the communication to take place. The DS1307 datasheet says that the device supports 100kHz frequency on the I2C bus. How come it ended up using 32kHz instead? Is there some kind of handshake phase where the frequency is stablished? In the end, my question really is this: How is the clock frequency established between master and slave in I2C protocol? I couldn't find that information searching the Net. In case this matters, I'm using Arduino IDE 1.03 and my firmware handles the RTC using the DS1307RTC Arduino lib (through its functions RTC.read() and RTC.write() ). That lib in turn uses Wire.h to talk to the RTC. <Q> For a rising clock edge occur in I2C, the master must assert the clock, which may cause some slaves to join in asserting it as well, and then the master and all slaves must concur in releasing the clock. <S> Until all devices release the clock, it will remain asserted and all devices will see that it's asserted. <S> Once every device has released the clock, then each slave device will "re-arm" the clock-hold circuit unless or until it will be ready for the next rising edge [some devices are always "ready" for rising edges as fast as the master can send them, and thus don't need a clock-hold circuit at all; others may sometimes know they won't be interested in any rising edges until the next start condition appears, and not re-arm their clock-hold circuit until then]. <S> When the master sees that the clock is released, it waiting some minimum length of time to ensure that anyone who needs to re-arm a bus-hold circuit has a chance to do so, and then re-assert the clock and ensure that it's held long enough to allow any armed bus-hold circuits to join in holding it. <S> The cycle can then repeat. <S> Slave devices generally do not have a minimum speed of operation, but will have a maximum. <S> Some devices synchronize all their I2C logic to an internal clock, and may thus require a cycle or two to arm or trigger their clock-hold circuit. <S> Additionally, I2C requires that devices must 100% reliably determine whether edges on the clock wire happen before or after edges on the data wire; since data line changes often occur almost immediately after falling clock edges, devices may add some delay in when they perceive data-line changes. <S> This requires adding a delay between any time the master changes its data output and the time it raises its clock. <S> Provided every device has its minimum delay requirement satisfied, the master can delay as long as it wants; the longer the master delays, though, the longer it will take to send data. <A> Following up the comments: Yes, the frequency is hard-coded into some specific I2C-related registers. <S> At runtime. <S> That said, your Arduino library might be doing some probing and rise time measurement on the bus for determining a viable clock rate. <S> Let's see. <S> After doing a bit of source-digging, the answer is in twi.h <S> #ifndef TWI_FREQ#define <S> TWI_FREQ <S> 100000L#endif <S> Another piece from that very file: TWBR = <S> ((CPU_FREQ / TWI_FREQ) <S> - 16) <S> / 2; <S> Where TWBR stands for Two Wire Baudrate Register <S> I suspect. <S> I'd call that enough evidence and definitely say, yes your I2C frequency is set directly by your library without any negotiations. <S> If you want to change it, I'd suggest you #define TWI_FREQ before you #include twi.h (or indirectly through Wire.h) <A> From The Arduino website- <S> Wire Library <S> Detailed Reference : <S> The twi.init() call is internal to the Wire library. <S> It performs the following tasks: sets the clock frequency that the TWI hardware will use if/when it is the master on the I2C bus. <S> It is set in the source code to 100kHz, but theoretically at least you can reset this frequency by redefining TWBR prior to calling Wire.begin() <S> , eg: <S> TWBR=400000L should set it to 400kHz. <S> The RTC library you use doesn't change TWBR. <S> Something else you are using might have changed it. <S> Or the long slow pull-up time from the super weak internal pull-ups have effectively caused the ATMega's i2c engine to slow down. <S> The engine does check to see if the line is high or low before changing it. <S> That said, i2c clock frequency is arbitrary , up to the lowest maximum supported frequency of any device on the the bus (and maybe a few tens of Hz more). <S> Any faster and you start getting read and write issues. <S> Some devices have minimum frequencies before they time out, but I've seen 400khz devices work at 10khz. <S> There is an option for clock stretching on the slave's part (it holds the clock line low until it's ready, and the i2c spec requires that the master check for this), but the scope pictures don't seem to indicate that this is happening here. <S> If you were to add some proper external pullups, without changing any code, you should see the frequency increase closer to 100kHz as the Wire Library defines as standard
The clock speed is solely decided by the master (i.e. you, the coder).
Can I screw up my board by guessing which RS232 pins are which? I have a Raspberry Pi that I want to hook up to a serial (RS232) cable. I've found and read some information about this, so I know what pins on my RPi are Rx/Tx/3.3V/Gnd... Now the cable I'm hooking it up to has a standard RS232 connector on one end, the other end is just four female header connectors. I do not know which if the 4 connectors is which Pin for the RS232. Will I cause any trouble if I "guess" which pin on the RPi should be connected to which of the header connectors? I'm thinking it just won't work right until I get the combination right, but I'd hate to screw up the board because I guessed wrong. The cable has been around for a while, there's no documentation or anything. It has HAURTIAN E164535 and I bunch of other stuff printed on it, but when I searched for that it just showed a standard RS232-RS232 cable, not what I have. Also I can't seem to find this "HAURTIAN" company to check for documentation there. <Q> The Raspberry Pi's seriall port pins on the GPIO header are 3.3 volt logic levels direct from the processor. <S> The processor will likely be damaged if you connect real RS-232 signals to those pins. <S> You will need an RS-232 interface chip (MAX3232 or similar) to invert the RS232 signals, and convert them to 3.3 volt logic levels. <A> Your best option would be to get a multimeter and use it to figure out what's connected to what between the two ends of the cable. <S> However, in general, as long as the equipment uses proper RS-232 interface chips, there's no harm in guessing. <S> The drivers are specifically designed to be current-limiting, so connecting two outputs together or an output to ground won't damage anything. <S> Homebrew interface designs, on the other hand, might not be as forgiving. <S> You can still guess, but I'd recommend using a series resistor (about 1kΩ) on any connection you're not sure of. <A> Yes you can...if you only hook the rx of whatever device you are using to talk to/from the raspberry pi and guess at the tx, then load a program on the raspberry pi (remove the sd card, etc) <S> if you see characters then you have that right, when you hook the tx from your other device to the raspberry pi if you guess wrong there <S> you could hurt one or both devices/boards. <S> Not hard to count the pins on a raspberry pi though to find rx and tx. <S> note this is NOT RS232, <S> RS232 is a line level thing not a serial standard thing. <S> this is uart or serial but not RS232...
If your other device is RS232 yes you will hurt the raspberry pi even if you wire tx and rx properly. Then you should use a multimeter to determine which wires in the cable connect to which pins on the RS-232 connector.
Is there such a thing as a switch that can be actuated automatically? I'm interested in a toggle switch that can be toggled without user input. That is, the physical state can be toggled electrically. It would need to incorporate some sort of motor or magnetic actuator. My google-fu is weak in this area, and I haven't been able to come up with the correct combination of search terms. Note that I'm not talking about a relay; I'm talking about a normal toggle switch: Except that it can be toggled without user input. As in, the lever physically moves. Like a "useless machine" except that the mechanism is internal to the switch. <Q> What you are looking for is a rare beast. <S> Honeywell produce a toggle switch (2 position and 3 position) that can be remotely reset by removing the holding current - <S> this releases the magnetic force exerted by a small solenoid and the switch returns to off or centre. <S> This may do what you want <S> but, I suspect that you would want to be able to toggle it at <S> will remotely: - Why can't you easily find one that can toggle in both directions? <S> Complexity and performance expectations leading to unfeasible cost and therefore NO foreseeable market is the main reason. <S> Hey it was hard enough to find this one let alone one that can be operated at will in both directions remotely. <A> It has a 100mm stroke, which you'll want to restrict to maybe 15-30mm, but with a suitable knob, and a microcontroller you can emulate your motorized switch. <S> You can even provide feedback and make it feel like a snap action switch. <S> When it's moved away from one position, it pushes back a little bit, until it's moved past center, then it accelerates to the other position and stops. <S> You can define your own spring constant for the snap action, up to the force of the motor control, anyway. <S> It would take up a lot of space, but might fit your needs. <A> I couldn't find anything online either, but I did find a patent that was close: http://www.google.com/patents/US20110316655?cl=en <S> It seems to be pretty recent too. <S> Their figures don't look like a typical toggle switch, but reading the abstract and skimming the article makes me think they are trying to do the same thing. <S> Searching for "Magnetically Actuated Switch" and similar terms seemed to get me a little closer, but searching along the lines of "Electrically Actuated Switch" keeps pointing to relays and tutorials about switches in general. <S> Hopefully this helps a little bit at least. <A> The closest thing that I can think of are Syndyne SAMs <S> (Stop Action Magnets). <S> They are designed and primarily used for organ consoles, where the stops need to be set manually by toggling the SAM, but where their states may also be saved and recalled at the push of a piston (small button under the keyboard). <S> I'm not going to repeat the specifications because all of that can be found on the website I linked to, but basically each has an electromagnet to pull the switch on when powered, and another electromagnet to pull the switch off. <S> They operate very quietly and smoothly, but still have a gentle tactile feel. <S> Syndyne also makes Solenoid Draw Knobs , which accomplish the same task in a slightly different fashion. <S> Last I checked, the SAMS cost somewhere around $30 to $50 each, though I'm not sure if Syndyne sells to individuals. <S> They can sometimes be found on eBay, and some organ salvage businesses might have some to sell as well. <S> I'm not sure about the SDKs. <S> Also, I realize this post is old, but perhaps someone might still find this info useful. <A> It's called a relay, normally. <S> There are latching versions that can act like a toggle switch. <S> Though there are various types of solid state switches that may solve the problem as well. <S> Without more information about voltage and current levels, control signals, etc. <S> it's difficult to make a specific recommendation. <A> It might be possible to make one with a solenoid, but that sounds like a lot of work. <S> You could fake it with a momentary toggle switch that returns to the center, and put an LED above and below it, and light up the one coresponding to the virtual switch position, but that's not quite the same. <S> It would be an interesting UI though. <S> You could attach a knob and encoder to a stepper motor, and make a rotary switch, or use an analog feedback servo <S> http://www.adafruit.com/products/1404 instead of a stepper and encoder
You can get a slide potentiometer that is motorized. Also, there appears to be magnetically held switches , but they don't actuate.
How to calculate power consumed by an electrical device in a specified amount of time? Say for example I have a TV with "140 watts" marked on it. Does this mean the TV consumes 140W per minute? Per hour? Per day? How is the power consumed by device calculated from the device specification? <Q> If a car is travelling at 40 mph it doesn't mean it travels at 40 mph per minute. <S> If a TV is consuming 140 watts it means it consumes 140 joules per second. <S> What you get charged for by your utility company is joules and <S> that is oddly (but acceptably) converted (without mathematical error) to watt seconds or more conveniently <S> watt hours or kilowatt hours. <S> Maybe that is what confused you? <A> A watt is a joule per second. <S> It is a measure of power. <S> A joule is a measure of energy. <S> You rarely if ever see things represented in watts per unit time. <S> See more: at this wikipedia link <A> If you want to calculate the amount of energy consumed by your device in a certain amount of time, multiply the power rating of your device by the period of usage. <S> For example: If you have a 100W lamp that is operational 24 hours for a full month, how much energy does it consume?How is that useful? <S> First, for energy consumption Q = <S> Power <S> * time = 100 * 24(hours a day) <S> * <S> 30(days <S> a month)= 72000 <S> Wh (Watt-hour <S> ) = 72 kWh (kilo Watt hour) <S> a monthWhich is a measure of energy. <S> Now how is this useful?You can see how much do you pay for it in a month. <S> You will have to see first how much does the company charge you for kWh?
To calculate power consumed by an electrical device for a specified amount of time you multiply the power by the time.
What gauge wire for 36V (DC), 5A peak? I've searched online and found wire gauge calculators but I still can't seem to find a reliable answer. What gauge wire do I need to carry 36 volts (DC) at 5 amps (peak) for 4 meters? This cable will be used for a video arcade machine light gun, and the power drives a solenoid which is only active for a few milliseconds. The current draw should be zero until the light gun is fired which quickly activates a solenoid and then stops but the gun can be fired in rapid succession... (which can cause a fairly steady (?) draw of 5A to continuously activate the solenoid) Would an 18 AWG wire be sufficient, or do I need to go bigger? ...or can I go smaller? Voltage drop isn't too important because the solenoid circuit can use 24 - 36V and will be powered with a regulated 36V power supply. I just don't want the wire to heat up or catch on fire, heh. edit: I'm looking to use a stranded wire for flexibility (in case that matters)... edit: This is related to a previous question , where a cable length of "10 to 15 feet at the most" is mentioned. <Q> DO NOT GO NEAR THESE <S> LIMITS <S> DO NOT GO NEAR THESE <S> LIMITS <S> DO NOT GO NEAR THESE <S> LIMITS : <S> - So what should you use? <S> I'd use this calculator - it seems to do the job: - <A> NEC ampacity is 14A for wire with 90°C insulation (reference Wikipedia for all figures) <S> The voltage drop of a loop 30' long is 5A * 6.385\$\Omega\$ per 1000' * 30/1000 or about 1 volt. <S> If your supply is 36V, that's not very significant. <A> What @Andy said. <S> Does the pulsed nature of the current reduce the requirement for the wire gauge? <S> It could. <S> The limit is actually an RMS current. <S> You know what the max fire rate of your gun will be, so you can can calculate the duty cycle. <S> Your RMS current will be lower than 5A. <S> When the 5A is flowing, the voltage drop will be the same whether 5A is a pulse or continuous. <S> (Obviously.) <S> There may be a failure mode where the supply line is shorted in the gun. <S> For instance, it can happen if somebody physically abuses it. <S> To mitigate this, add a fuse at the supply end. <S> A slow fuse or a PTC fuse may be preferable. <A> #18 wire should be sufficient. <S> Light duty AC extension cords are #18, and are rated for 5 amps.
AWG 18 wire is fine for that current handling capacity. The current limit is driven by the heat generated by the wire resistance. The fuse should have a slightly lower rating than the wire.
Solar cell powered supercapacitor charger with strange output voltage regulator problem I have a strange problem in a low power circuit design. I designed a buck-boost converter as a maximum power point tracking circuit (control the output of solar cell within a small voltage range within +/-5% of its maximum power point) for small solar cells (3.5V 0.2mA typical output in indoor light condition). The buck-boost converter works fine. The output is used to charge a supercap with 2F capacitance and 2.5V voltage rating. Then I figured I need a regulated voltage at the output end (3.3V or 5V). So I used a TI TPS61221/2 boost converter as the output voltage regulator. I found out that, for large capacitor such as the supercap, there is a problem during the startup. When I start to charge the supercap from 0V to 2.5V, the TPS6122x will try to start up when supercap voltage reaches 0.8V, but it will fail to start up and the voltage will fall to 0.6V. The oscillation will repeat over and over again, and never start up correctly. So I decided to include a "startup" circuit using a MAX9064 comparator and a TI TPS22902 load switch. My idea is that it will only start to connect the supercap output to TPS6122x when the supercap (SC) voltage is higher than 1.5V. (There is hysteresis I set on the comparator for a rising edge 1.5V, falling edge 1.0V, but I didn't draw it in the schematics here. Input and output capacitors for TPS6122x do exist, but also not draw in this.) The min Vcc for MAX9064 is 1V. I connected (with diode) from solar cell, TPS6122x output and supercap to a "Vcc capacitor" in order to get C2 a >1V voltage during start up. Pull down resistor used on the output of MAX9064 to ensure a low on the TPS22902 enable. See the attached picture. However, funny enough, this circuit sometimes works sometimes not! Which means it still have the strange oscillation at 0.8V when I explicitly disconnect it with a load switch. Nothing should happen before the supercap reaches 1.5V. But if it is always like that, I'm going to change the circuit. But then I found out, many times it works just fine! It goes to 1.5V and start up the TPS6122x. I'm very confused that is there a problem with the set up? What could cause this funny problem? Pull-down resistor? Load switch problem? Vcc? Or supercap itself? <Q> What is the frequency of the oscillation you observe? <S> If it is relatively low frequency, then the drop is probably caused just by energizing the TPS61222 output cap and inductor. <S> You could fix that by adding more hysteresis on the comparator. <S> Seems unlikely to me, however, because the super cap is so large. <S> If it is highish frequency, it could be caused by inductive and resistive drops in the path between the supercap and the input to the TPS61222 (including the internal resistance of the supercap itself, which is likely considerable). <S> Again, adding more hysteresis on the comparator will help fix it. <S> You can also improve the situation by using a bulk input capacitor right next to the inductor to hold the input to the TPS61222 in the face of the relatively large currents you will see at startup - this will work if you take Simon's recommendation and drive the EN pin of the boost converter instead of a load switch. <S> That recommendation is likely a good one anyways, since it saves you a part. <S> Note that if you are running a load at the output of the boost, you may observe some sort of "oscillation" any time your load power exceeds the input power from the cell. <S> The solar cell will charge up the super cap until the boost turns on, at which point the power drawn from the SC exceeds that going in and the voltage starts to drop. <S> It continues dropping until the TPS61222 turns off / gets disconnected, and then the process starts over. <A> You will probably find the caps are storing charge so that the comparator is acting as a memory. <S> This memory can last for tens of seconds due to the low currents. <S> Try removing the comparator & load switch altogether and use the EN pin on the TPS61222 as an enable (two resistors will do), (see page 4 of data-sheet for ideas) or use the comparator to turn on the EN pin (or better still a 3-terminal POR reset chip). <A> You have basically created a small tank circuit. <S> The problem is that if the resonant frequency of the tank circuit reaches the feed back, there will be harmonics causing it to stop charging. <S> The same idea that is typically used to stop a contact breaker from chattering. <S> I work in the induction heating field and I work with a lot of oscillation or electrical noise issue giving faulty feedback signals.
I would put a small load inline with the resistor/capacitor that can be turn on and off as needed acting as a buffer.
Is "True RMS" applicable only to measuring AC voltage? Higher end multimeters feature "True RMS" rather than "averaging" voltage measurement. Is this applicable only for AC voltage measurement? <Q> Usually only AC ranges, which are AC coupled so you lose the DC component of the signal. <S> The reason why you would not want the true-RMS to apply to the DC voltage range is that the accuracy of true-RMS measurements is usually not nearly as good as averaging DC measurements. <S> For example, the Fluke 170 series datasheet here, shows these specifications: <S> The True-RMS AC measurements are almost two orders of magnitude less accurate than the DC measurements. <S> A bit higher end is the Agilent 34401A <S> You can see that the accuracy is more than an order of magnitude worse for the True-RMS AC range. <S> Practically defining the high end, the Agilent 3458 offers several AC methods of measuring RMS AC. <S> Even the best (and most restricted) <S> True RMS AC measurement technique is more than two orders of magnitude less accuracy than the DC ranges (a few ppm). <S> Here's a one-chip RMS converter, the LTC1966 <A> It depends on the multimeter. <S> Most multimeters are AC coupled so if a signal with both DC and AC is applied, the multimeter will only read the RMS value of the AC part of the signal. <S> Even then the measurement is limited by the low frequency response of the multimeter which is usually in the 10 Hz region (it is, of course. <S> also limited by its high frequency response which can range from the low kHz to several MHz for typical multimeters). <S> If the multimeter is DC coupled on its true RMS ranges then it will read the RMS value of the signal including the DC component. <S> However for most applications, this measurement is usually not of interest which is why most meters are AC coupled on their AC ranges. <A> "True RMS" denotes a meter that really is measuring the RMS value of a signal, so it works on any waveform, AC or DC [1] . <S> It's the other meters — the ones that measure either peak or average and then scale it to an "RMS" reading — that depend on the waveform being a sinusoid (AC) signal. <S> [1] <S> At least in theory — many meters block DC when in an AC measurement mode, because this makes it easy to measure both the DC bias of a signal and its AC component separately by just switching modes.
For DC measurements, true RMS is irrelevant since the RMS of a pure DC voltage is equal to the DC value.
How to mirror resistor? (use same variable resistance for multiple op-amp gains) I want to create parallel op-amp circuits/channels and use the value from a single potentiometer to adjust the gains of each uniformly by making each op-amp see a 'copy' of the resistance to set the feedback gain - the amps in question are TL072's and I'm looking to make at least 4 seperate channels. Is this possible - do any circuits come to mind? <Q> If you are working at audio frequencies I would recommend using a monolithic Voltage Controlled Amplifier (VCA), with the analog control voltage coming from a single potentiometer, and perhaps a buffer driver for low impedance to drive the higher impedance gain control inputs of your 4 channels. <S> A single channel VCA is the SSM2018 from Analog Devices. <S> The 4-channel <S> SSM2154 is obsoleted. <S> I am sure there are similar devices from other vendors. <S> If you are working with anything higher than audio frequencies then you should look at the vendors' selections of Variable Gain Amplifier (VGA) and Programmable Gain Amplifier (PGA) devices. <S> However these are likely to be set by a 6-bit to 8-bit digital control and not via an analog control voltage that would easily be obtained from a potentiometer. <S> A simple approach is to use a JFET shunt VCA topology. <S> This picture is courtesy of Elliott Sound Products ( https://sound-au.com/articles/vca-techniques.html ) National Semiconductor AN32 from 1970 has a JFET as an attenuator at the input to an op-amp. <S> In this configuration you would use a fixed gain to gain-up your output to a maximum and attenuate it down at the final stage using the control voltage. <S> The image below would be the final stage, after your gain stage. <A> If you consider the following device: - Now consider the action of analogue switch (whose control input is driven by the LTC6992 i.e. it is being toggled on and off at 1MHz). <S> You should recognize that you can control an analogue signal amplitude by feeding it through the "toggling" analogue switch. <S> The higher the duty cycle, the more the signal gets transferred to the output of the switch: - <S> In effect you are pulse width modulating the analogue input signal and the average level of the signal is determined by the input signal and the mark-space ratio of the PWM. <S> It's a fairly accurate 2-quadrant analogue multiplier. <S> After the analogue switch you need a fairly simple low pass filter to remove the high frequency switching artifacts. <S> So one PWM chip operating up at 1MHz, several analogue switches (1 per audio channel) and several op-amp based sallen-key filters to remove the HF noise and this should work. <S> 1 potentiometer connected to the input of the LTC6992 will control the amplitude of several signals by the same factor. <A> The problem with VCAs and voltage-controlled resistances is achieving perfect tracking of the gain in each channel. <S> You don't say how accurate you need the channels to be matched to each other; if somewhere around 0.5 dB variation between channels is acceptable, you have a wide range of options to choose from. <S> The SSM2018 mentioned in another answer is very very good, but its datasheet notes (p.11): A 25°C temperature change causes a 8.25% increase in the gain <S> constant, resulting in a gain constant of 30 mV/dB. <S> The much cheaper (dual) LM13700 features 0.3dB <S> gain tracking between different amplifiers according to its datasheet. <S> However if you need much better gain matching between channels, take a look at an MDAC - Multiplying DAC - which is a switched attenuator, with the gain setting applied by changing the code on the digital inputs. <S> So you would need to read the pot in the ADC built into a microcontroller and write the appropriate code out to the MDAC for all channels. <S> The gain matching achievable is limited by the precision of the MDAC, and you may be able to achieve higher bandwidth than devices specialised for audio use. <A> One way to do this is to use a EEPOT (Electrically-Erasable Potentiometer). <S> They come in all values from 1K to 1M, and have up to 6 pots in one package. <S> Here is the datasheet for the AD5253/5254 , which is a quad EEPOT. <S> You would obviously set all the pots to the same value in your case. <S> You will need to have a microcontroller to set the resistance value, as the EEPOT runs off of an I2C bus. <S> Virtually all microcontrollers these days have I2C. <S> You wouldn't even need to have a fancy user interface, just up and down buttons that would raise and lower the resistance value. <A> So after some more research I found you can make a voltage controlled resistor using a FET and also this instructable <S> that uses an LED and a photocell and resistive opto isolators also fit the bill. <S> There is also an 'active resistor' or 'active load' used in integrated circuit designs but all the material I could find on the circuits were well beyond me at present.
If you needed to set the EEPOT to an exact value, you could add a serial interface to a PC using a UART to USB converter, like this one , which would allow you to set the resistance via a terminal program on the PC like RealTerm .
Sniffing a proprietary data line at 47.5V I need to sniff the physical layer of a proprietary data line with a logic analyser, but my analyser is limited to 5V input. Unfortunately the line runs at 47.5V, which would fry everything. I considered a simple voltage divider, but I'm concerned that I might pump a lot of current through it, or affect the data on the line. Any suggestions on a way to do this? It doesn't need to be robust - it's just a one-time hack for a single purpose. EDIT : To answer some of the questions asked: I don't know if it's 47.5V DC offset or 47.5V p-p, as I only have a single figure given to me as part of the spec. It's an old system produced by a company that no longer exists, so getting original specs and info is practically impossible. The data rate is 2Mbps, which to me implies that it shouldn't exceed 4MHz at the physical layer. <Q> Two options. <S> Option 1. <S> If data is fully swinging from 0V to 47.5V <S> then a voltage divider using two resistors is fine. <S> Choose values of resistors that are not too low so that excessive power is dissipated. <S> Check also to see how much the line can be loaded with. <S> If necessary, make a pseudo scope input from 1Mohm and 100k potential divider - this will produce about 4.3Vp-p BUT, you may need to put 22pF across the 1M and 220pF across the 100k to keep "edge" information in the data stream clean. <S> Option 2. <S> If the data is 5Vp-p superimposed on a dc level of 47.5V <S> then it's more complex - <S> this is like "phantom power data" and to "read" the 5Vp-p data you need to remove the DC by using a capacitor - <S> this leaves you with an AC data signal that is 5Vp-p but undulating up and down with the average mark-space ratio of the signal. <S> However, if the data is similar to UART data, there will be long periods when the signal is 1 or 0 and this is a problem that you may never solve easily. <A> Here's a simple inverting circuit that should work, provided you can safely connect the grounds together. <S> It presents a very light load (120K) to the signal, and should work okay up to maybe 50 or 100kHz. <S> If you need higher frequency response, shunt R1 with a few pF. simulate this circuit – Schematic created using CircuitLab <S> This assumes the input signal swings from 0 to +47.5V <S> so sets the transition at around 20V. <S> As Andy says, if your signal does not swing 0/47.5 then other means must be used. <S> Note that it is inverting, so output is low for 47.5 in and high for 0V in. <A> Even though this is most likely a DC offset scenario, you can eliminate the peak/peak possibility for your sanity. <S> Take an appropriately sized resistor, and an LED, and connect this between the signal and its reference (ground). <S> If the LED is constantly lit, it is an offset scenario. <S> (If you are swinging 48 volts then at some point that signal will be below ground and the LED will be off.) <S> Hopefully your ground team can manage this much. <S> So, let's assume this is a DC offset scenario where the voltage could swing significantly around 47.5V. I propose using a level shifter circuit, using two resistors and an NMOS, to bring the voltage down to a 5V range. <S> You can adjust the range by adjusting the resistor ratio. <S> I played with this a bit in LTSpiceIV and the idea seems to hold up. <S> http://husstechlabs.com/wp-content/uploads/2010/09/Level-shifter.jpg <S> However there will still be some DC offset present, and the swing won't be optimal for a TTL UART bus, so you'll need to condition further. <S> A single instrumentation amplifier should be able to difference the signal with a DC level, and gain it properly to 0-5 V. http://en.wikipedia.org/wiki/Instrumentation_amplifier <S> Also the level shifter might give a spiky output - use a decoupling cap before the input to the instrumentation amplifier to mitigate this.
If the data is encoded in such a way that there are always data edge transitions then that's fairly easy - connect the dc-removed signal into a signal comparator that has a 0V/5V output then feed that into your analyser. If the LED flickers, it is a peak/peak scenario.
Light sensor to sense light level I have an application where I am trying to monitor a defect in a web based manufacturing process. This defect can be seen if one side of the substrate is lighted and the transmitted light is viewed from the other side. When the defect occurs a change in the transmitted light is noticed. I am looking for a commercial sensor which I can use to give me an analog signal. I also want to experiment with a sensor on a breadboard to get an understanding of how a change of light translates into an electronic signal. My application will require a very low response time as the speed of my process will result in the defect being in front of the sensor for less than a millisecond. Any direction on sensors or components will be appreciated. <Q> CdS light-dependent resistors have realtively high sensitivity and are easy to use, but generally too slow to measure something only 1 ms in duration. <S> Sensors based on semiconductor diodes are probably the most appropriate. <S> There are also photo-multipliers, but those are more complicated and usually only appropriate when the light levels are very low. <S> Semiconductor diodes can be used two different ways to sense light. <S> These are forward mode where the diode is used like a solar cell, and reverse mode where light effectively causes leakage thrue the reverse biased diode. <S> Reverse mode is more linear, but usually needs considerable amplification to get a useful signal. <S> You also need to consider the spectrum of what you are trying to sense. <S> The particular wavelength may dictate a particular sensor. <S> Note that in a pinch LEDs can be used as photodiodes. <S> These usually respond to a narrow range of wavelength around what they emit in normal LED mode. <A> For stability and accuracy, I would suggest a silicon PIN <S> (P-Intrinsic-N) photodiode. <S> Response time in the microseconds is not too difficult with good design <S> (you'll want the response to be an order of magnitude faster than the time the sample is in front of the sensor). <S> Phil Hobbs has a good article here on photodiode front end design. <S> You may just need a simple transimpedance amplifier as this one using the OPA128 (there's a mistake in the schematic on the datasheet- <S> the resistor should go to the PD bias voltage, hey nobody's perfect). <S> if there is plenty of light available (so you can use a really low capacitance PD), but if you need more, that article (and his book) are a good guide. <A> A photodiode should give you the analog signal you need. <S> As for an exact component you would need to weigh up the amount of illumination, wavelength and probably other things to select the best component. <A> Can't argue with using a PIN photodiode as others have said. <S> Consider another problem though.... <S> Ambient light and variations in the light level emitted by the illuminating device. <S> You need to factor these into your design. <S> I'd use a low power laser (divergence angle to suit your requirement). <S> I'd consider pulsing it to overcome ambient light problems <S> and I'd use a laser with inbuilt photodiode so that you can accurately control the light emitted. <S> This should work better and more consistently than an unmonitored continuous light source. <S> One more thing, for consistent accuracy try and control the temperature of the receiving photodiode or consider a two phase measurement where you take a reference light intensity measurement of the laser without the "thing" you need to measure being in position
You can also get a phototransistor, which works like a photodiode but includes some transistor action to multiply the raw leakage current by the gain of a transistor, all in one device.
Why set PORTx before TRISx? I was browsing through the example code that MikroE provides for PIC programming using MikroC, and they always set PORTx before setting TRISx. What is the reason for this? Since TRIS just selects whether the port or pin is output/input mode, why does it matter what the pin is set to before we set the mode? Example code PORTA = 255; TRISA = 255; // configure PORTA pins as input PORTB = 0; // set PORTB to 0 TRISB = 0; // designate PORTB pins as output PORTC = 0; // set PORTC to 0 TRISC = 0; // designate PORTC pins as output <Q> The PORTx bits are adjusted before the TRISx bits <S> so you know what the output will be before you make the pin an output. <S> If you are setting the TRISx bits to inputs, it doesn't matter. <S> However, if you are clearing the TRISx bits and making them outputs, it is safer to determine what the output will be before it switches from input to output. <S> Thus, if an alarm or something goes off when a pin is high, you would want to make sure when it becomes an output, it starts off low. <A> For this specific bit of code the answer is that the programmer wants to set the pins to a known state/voltage before setting them as outputs. <S> But in general, the TRIS bits do more than just set a pin to input or output mode. <S> The TRIS mnemonic stands for tri-state. <S> When a pin is tristated the resistance of that pin goes so high that they're effectively disconnected from the circuit. <S> If you've ever looked at busses you'd have seen tri-state circuits. <S> They're the poor man's way of connecting multiple outputs together without using a multiplexer or a switch. <S> All you need is to make sure that there is only one output on the bus that is not in tri-state mode at any point in time. <S> The values on the bus gets VCC voltage via one or several pull-up resistors. <S> Lots of serial busses do this. <S> If I remember correctly CAN bus does this. <S> Contention is never a problem with this scheme. <S> You just need to take care of collisions which can be done in software. <S> Therefore in a lot of code I've worked with (and indeed in a lot of my own code) <S> the PORT bits are hardcoded to 0 and the pins are driven by setting the TRIS bits to 1 or 0 . <S> So you will sometimes see code in production where the outputs are controlled via the TRIS bits rather than the PORT bits. <A> If you set outputs low before tris, they are guaranteed to be low after the tris. <S> Maybe! <S> I guess this assumes the output port register may contain random bits or <S> maybe they are all hi after a reset.
Maybe it's a way of preventing output glitching hi then low straight after a tris. There is also a "safe" method of implementing busses by not allowing any device to output any voltage other than zero volts.
Why don't all motors burn up instantly? A motor rated for 3S (11.1 V) has an internal resistance of 0.12 ohm. The maximum current is 22 A. 11.1 V / 0.12 ohm = 92.5 A Doesn't this mean that by supplying a 11.1 V three phase current, the motor will burn up instantly? How does an electronic speed control (ESC) prevent the current from exceeding 22 A? <Q> It doesn't, the motor itself does. <S> Once the rotor starts spinning, the motor produces a voltage that opposes the flow of current; this is commonly called "back EMF (electromotive force)". <S> The motor's speed increases until the back EMF reduces the current flow to the level needed to account for the actual physical load on the motor (plus losses). <S> The heavy current you calculate is drawn only for an instant, just as the rotor starts spinning. <S> If the rotor is prevented from spinning, then that current will be drawn indefinitely, and yes, it can destroy the motor. <A> Don't forget about the inductance and back EMF. <S> If you were to put 11.1V DC across the winding you would wind up with 92.5A of current in that phase, but the impedance to an AC signal is higher. <S> Once the motor starts turning it generates an internal voltage, the back EMF that fights the drive voltage. <S> In many drives the current is controlled via current feedback from each phase, so that the drive current can't exceed the maximum. <S> Other schemes have over current protection provide by a comparator on a sense resistor at the bottom of the 3 phase bridge. <A> An inductor may have a DC resistance of 0.1 ohms and if you supplied it with 10 volt DC it would dissipate 1000 watts and probably near enough instantly fry and smoke. <S> The thing about a motor is that it either commutates (dc motors) or it is fed from AC (which is another way of commutation) .
The point is that the voltage to the "active" coil part of a motor reverses polarity often enough to prevent the DC situation causing burn-out.