text
stringlengths 83
79.5k
|
---|
H: What NPN transistor should I use?
I need to control a 12 V 5 A (or 3 A if need be) with an Arduino UNO which has 5 V and 40 mA. Unfortunately I don't know how to read transistor data sheets. What NPN transistor should I get for this project?
AI: You shouldn't use an NPN transistor for this project. There are parts out there that will work by an N channel, logic level MOSFET is a better choice. It's \$R_{DS}\$ in saturation will be very small, and it won't waste power as heat. Take a look at a part like this one. \$R_{DS}<10m\Omega, P=I^2R = (5A)(10m\Omega) = 50mW\$ That is pretty good.
You'll implement it like this:
simulate this circuit – Schematic created using CircuitLab |
H: how to calculate total resistance in circuit with parallel and series resistors connected
A battery of EMF 8.0 V and internal resistance r = 1.0 – is connected to an external circuit as shown:
I need to find out the total resistence and my problem is that I dont know which resistors consider parallel and which are in series as there is connection for 3ohm resistor after 1st resistor which confuses me. Answer I got is that the total resistance is 15ohms could anyone confirm it? Or point out where I went wrong?
AI: Start with the part that's easy, and work your way out. 6 ohms in parallel with 12 ohms is 4 ohms. 4 ohms in series with 2 ohms is 6 ohms. 6 ohms in parallel with 3 ohms is 2 ohms. 1 ohm in series with 2 ohms in series with 4 ohms in series with 1 ohm is 8 ohms. |
H: Conversion of voltage of battery
I have 9 volts battery. What resistance do I need to have 5 volts. And how to calculate?
AI: You need to know the current you will draw, and then use Ohm's law to calculate the resistance. For example, if you draw 4 mA then the resistance will be 1000 Ohm.
However, as the current used by your circuit may vary, using a simple resistor will allow the voltage to vary: if the current drops 50%, your circuit will see 7V. If the current doubles, it will see only 3 V.
Because of this you really need to use some kind of voltage regulator - as Grant suggested while I am typing this. |
H: How to drive high power LED and Arduino by the same power source?
I am building a plant light consisted of 24 high power LEDs (Cree ML-E) and an Arduino Uno. I would like to power the LEDs and the Arduino by the same power source. Since creating circuits for dealing with household power requires quite a lot of experience and also can be potentially dangerous, I decided to go for a commercially available AC-DC power supply similar to the ones for laptop, such as this (TRANSFORMER DESK TOP 24V 60W).
Coming with computer science background, here are some problems I would need advice for:
The fundamental problem: can these LEDs and the Arduino share the same power supply?
I suppose the power supply should have output voltage high than 12v, which is the maximum that an Arduino can take. How do I lower the voltage to the safe range of 7-12v?
The forward voltage for the Cree ML-E is 3.2v, therefore the wiring I can think of is first to create three series of LEDs, 8 in each. Then connect these three series in parallel. Is this a proper way of wiring or I was wrong?
I found there are LED drivers ready for use out of box, such as this (POWER SUPPLY LED 36W 700MA). Is it a good idea to use it to mainly power the LED and "fork" another power source from it for the Arduino?
Note: The Arduino is for the sensors placed at the same spot as the plant light
AI: You have asked a bunch of questions there which all have straightforward answers, but it's a bit much to try to cover them all in detail this space, but let me give some suggestions.
LED light for plant?
First, before proceeding, are you sure that LED light, which usually has a very narrow spectrum (or a few narrow lines), will be suited to plant light? I don't know about this, but it would be worth verifying before going to effort.
How to power and control LEDs
Next, you need a few clues about how to power and control LEDs.
You don't mention what the role of the Arduino will be -- will it be to turn the LEDs on and off, or do you want it to produce gradations of light intensity?
a) If on/off, you'll want an arduino shield that provides a relay or power-transistor which can switch an appropriate amount of current, which I'll get to below.
b) If gradations, you'll need a shield that can control the current in increments. Or, a popular alternative is an output controller that pulses the light very rapidly, controlling the overall light by the ratio of on to off time. This is referred to as "Pulse Width Modulation" or PWM. Again the PWM output switch element (transistor) needs to be rated for at least the amount of current you supply to your LEDs.
Edit: Arduinos usually have some outputs that are referred to as "analog outputs" but are actually PWM, so this capability is built in to the Arduino -- though you would still need to provide an external transistor to handle the current of the LEDs -- see examples online.
Supplying electricity to LEDs.
This is the mildly tricky part. LEDs are specified with a typical voltage and current number. For Cree ML-E: 3.2V at 150mA. So you might think "I'll hook eight of those up to 24 volts, and that'll be about right". Unfortunately, it's not so simple. LEDs have a characteristic whereby if you supply a little less than the nominal voltage, and they pass very little current and produce little light. A little more than the nominal voltage and they pass a great deal of current, and probably burn out.
So you don't want to supply a fixed voltage direct to an LED. Instead, you provide a supply which regulates the current. You'll notice that the LED supply you linked to is described as a constant current source. But you don't need to be that fancy. Instead, you can use a supply with a voltage higher than that needed by the LEDs, and put a resistor in series. Example:
Supply: 5V
LED: requires 3.2V, 0.15A
Voltage difference: 1.8V
Resistor: I = V/R So R = V/I, = 1.8/0.15 = 12 ohms. (And FWIW, P = I * V = 0.15 * 1.8 = 0.27 W, so choose a half watt or better physical size of resistor.)
Yes, you can put a bunch of LEDs in series, so for your example 6 x 3.2 or 7 x 3.2 would be possibilities, and still have some voltage drop left between the LED requirements and the 24 V supply. (You will need to factor in that whatever is switching the LEDs, such as a transistor, will also add some voltage drop to the chain.)
Generally, it is a bad idea to attach LEDs (or chains of LEDs) directly in parallel, because the actual voltage for the nominal current may vary from one LED to another, and from one chain to another. So multiple LED chains should each have their own series resistor.
Power for Arduino
Transforming 24V for use with Arduino: The easy answer here is a 7805 voltage regulator which is super easy to use. There are zillions of references for this on the web, so I'll not elaborate. Couple of things to attend to:
a) 24V -> 5V is a relatively large drop for the 7805, so you will need to attach it to a heat sink.
b) The switching of the LEDs will cause sharp changes in the demands on the supply, so err on the side of using relatively large capacitors with the 7805, and parallel them with smaller caps to help with the high-frequency aspect of the sharp switching. This thread is representative. Capacitor Sizes for 7805 Regulator.
[Edit] I'd neglected to note that the original question asked about Arduino with 7-12V power input, which is because Arduino Uno has a voltage regulator that handles the power from the Power In jack. The Uno can run on 5V from USB (when no power is supplied at the Power In jack), but if you are supplying power to the jack, then as the questioner mentioned, that will need to be 7V or higher. So a reasonable solution would be a 7808 or 7809 to obtain 8 or 9V from 24V. |
H: Is that possible to run AC motor through website?
I wanna know how is that possible to start ac motor through php based website. What tech or device do i need to look for?
AI: I'll hold my answer as general as you asked your question:
get a Raspberry Pi or something similar
set up Apache2+PHP
get a very strong relay which can switch on the AC motor and can take an input of 5V
connect the relay input to one of the Raspberry Pi GPIO output pins
connect the relay output to the AC motor
write a php script which lets you toggle the connected GPIO output pin of the Raspberry Pi |
H: What component/device to use for a front-eye display
I need to display information in front of my eyes, just like Google Glass, but in this case, it has to fill a bigger field of view (is it the good term?). I have already thought about a couple ways to do it, but I am not sure they be relevant :
1) Using reflection on a piece of glass, with a screen on a side. In this case, how can I make the reflection work, what kind of materials to use, the nature of the side screen ?
2) Some type of micro-projector
If possible I would like to plug it as an external display, to a simple computer, running any OS, and it is a plus if it can be displayed on a pair of glasses.
AI: The requirement is technically "easy" [tm].
It's "just a matter of doing it".
Making it compact and pretty may be harder :-).
"All" you need is a display with the resolution, size, weight, brightness and power consumption that you require and a lensing system to reduce the viewing distance to what is acceptable relative to your eye. A mirror or prism may be used to change direction by 90 degrees or some other angle.
Superb example of what can be achieved can be viewed (literally) in any of the SONY DSLR cameras which have OLED EVF displays instead of an optical viewfinder. The Sony A77 camera with XGA (1027 x 768) electronic viewfinder has perhaps the best example but there are others with lesser resolution
Excellent A77 EVF review
A77 eyepoint to lens is 27mm - which shows you what can be achieved.
A much cheaper way to start is to obtain some cheap +4 diopter reading glasses
($2 / pair here - YMMV), take out the lenses and look at your display with 1, 2, 3, 4, ... stacked together.
1 x +4 diopter lens gives you a ~= 1/4 = 0.25 metre = 250 mm viewing distance.
2 x +4 diopter lenses stacked (in close contact) gives you
8 diopter = 1/8 m focusing distance = 125 mm viewing distance.
3 gives you ~= 83 mm
4 gives you ~= 60 mm or about 2.4 inches.
...
Or stacking lower diopter lenses or a mixed set may give you better results.
Putting on several pairs of spectacles at once and looking at a book gives you some idea of what to expect. Quite reasonable quality can be achieved with cheap lenses. If you get serious enough you can get N diopter lenses ground to your specification. |
H: How can I communicate between micro-controller and PC without the use of RS232/USB Adapter?
I use an NXP micro-controller, P89V51RD2, and use a RS232 to USB converter to program it. I'd like to communicate with the computer to send data but without using the RS232 adapter and convert serial data from micro-controller to USB compatible form without the RS232 element.
Current stituation :
uC(serial) --> MAX232 --> RS232/USB adapter --> PC(USB)
Required stituation:
uC(serial) --> [some small circuit] --> PC(USB)
What can I do so that the new circuit is small enough to be burned on a PCB with the controller and directly interfaced with a USB?
AI: You seem to want to interface to an USB port, so you will need some form of USB interface.
The easiest route is an off-the-shelve usb-serial converter, then a max232 or the like, then the UART of your microcontroller. You apparently want to step beyond this.
A next step is to use an usb-serial converter chip, without the extra stage of going to RS232 levels (and back). The FT232RL is often used for this purpose, there are others. These chips interface directly between USB and the UART pins of your microcontroler. The FT232RL is a small SMD chip, it uses little PCB area but is somewhat more difficult to use than a DIP chip. If you don't want to do you own PCb there are various break-cout PCBs, and the manufacturer (FTDIchip) sells cables that have the chip built into the USB connector.
A next step could be to use a microcontroller that has a USB interface on the chip. For instance various PICs, AVRs and ARM chips have this feature. But this means that your micocontroller application will have to use the USB hardware. of the chip. This is doable (often with the aid of libraries provided by the chip manufacturer, or from thirds parties), but considerably more difficult than using a UART.
For the real die-hards there are libraries that implement USB on an AVR without using AVR USB hardware. The resulting device is probably NOT acceptable as an official USB device, but they seem to be working.
A problem with 3 and 4 (and sometimes even with 1) is that you need an USBstack on the host side, and in my experience all host stacks except for the ones FTDI offer suck (the ones for prolific-based usb-serial converters seem to suck less than most others). |
H: What is INCH/(MILLIMETER)?
This datasheet (see page 22) has the dimensions of its diagrams in "INCH/(MILLIMETER)".
What does INCH/(MILLIMETER) mean? Is it a unit of length? (I would expect it to be unitless, given length/length is unitless.) If it is a unit of length, what is 1 INCH/(MILLIMETER) in millimeters?
AI: It means the number that comes first is in Inches, and the second one in parenthesis is in millimeter.
So for something that's to be marked as 1 inch, it'd be 1.000/(25.40) |
H: Voltage Level Translation: LCD(5V) -> GTL2000 <-> MCU (3.3V)
I am trying to interface a micro-controller (LPC11C14) to a LCD. The LCD has Vih = 3.5V so I cannot directly connect the uC pin to the LCD. For this, I found a GTL2000 chip which looks like it might do the job. But here is the issue that i am not sure about.
I want bi-directional voltage translation because I want R/W facility with the LCD (for reading Status Read). I know that I can set the outputs of this CMOS microcontroller to open-drain, but I am not sure about the LCD (I don't think they are open drains). So I modified the bi-directional circuit shown in the datasheet to include resistors on the open drain side. The clamp resistors are calculated through specified formulas in the datasheet. GTL 2000 Example circuit
My question is this circuit likely to work?
Also, if I don't put the uC pins in open drain mode, I can remove the pull-up resistors on that side. Is that possible as well? The datasheet does not talk about standard GPIO behavior.
Thanks,
The LCD being is NHD-12864WG-BTGH-T#N, which has a Voh of 3.5V.
AI: You'd have to provide additional information about which LCD you're using. In general, though, what you are proposing will not work.
You can connect multiple open drain outputs together because open drain logic is essentially an OR of all the outputs. Each output only sets logic 0 or a don't care condition, so it's safe to connect multiple drivers together, and there is no contention. You cannot do this with a regular output (what the datasheet calls a totem pole output), because such an output asserts both logic 0 and logic 1. This means that there is scope for significant contention between the two sides. In your case, the circuit will simply not work, and likely cause a fair bit of damage.
Parallel buses are very rarely open drain. Just because you can set an output as open drain does not mean that it will remain open drain if you enable a bus controlling peripheral like an SMC (Static Memory Controller) and/or DMA. I haven't used the LPC myself, but I'd be very careful with it. Generally, as long as you use it as a GPIO it'll honour the open drain setting. Once you enable a peripheral, then it depends on the peripheral's requirements. Usually, open drain isn't fast enough a high speed parallel bus, and therefore they aren't designed to handle open drain.
The general way to handle voltage translation for such applications is to use high speed logic, and a combination of the WR/RD and CS pulses to set the direction of a more traditional level translating buffer like the SN74LVC1T45 and it's 2, 8, 16 bit variants. Given information about which lines need reversing and when, you can work out a scheme which does what you require. |
H: Why are the pads different for THT / SMT components in Eagle?
I am learning Cadsoft Eagle and have noticed that the pads for SMT devices are on the 'top'/'bottom' display layer, whereas the pads for THT components are on the 'pads' layer. Why is this?
I have enlarged the pads for the SMT device so that I don't commit Seppuku with my iron during hand production. Looking at the soldermask 'stop' layer, it appears that all is well, as the SMT pads are not covered. I just want to check that this difference between SMT/THT pads is correct before making my first batch of coffee coasters.
AI: The features in the PADS layer goes on all layers of the PCB (with actually some additional modifications when you're using more than 2 layers, such as having a smaller copper ring in the inner layers instead of the large pad). SMD components, though, exist only on one side of the PCB. So their pads go on TOP or BOTTOM depending on which side the component is on.
As an aside, be careful when enlarging pads. Go with lengthening the pads and not widening them, since that could reduce the space available between adjacent pads and make soldering it harder, even if it still clears the rules for the fabricator. Also, it become counterproductive to leave more than one or two millimeters beyond how far the IC pin is expected to go. The extra exposed copper makes soldering by hand slightly more tricky. |
H: Beginning programming for Atmel uProcessors
I'm taking the next step, going from my Netduino into the smaller microcontrollers from ATMEL (since there is no really tiny (tinier than the netduino) stuff running .NET).
Also have some experience with ATML and some (silly) assembly coding back from when I went to college. Assembly isn't my thing, my minimum requirement is C.
I'm looking at the ATTiny84 and ATTiny85 microcontrollers.
Since I don't have a Arduino Uno or whatever, I would need a programmer. The Atmel AVRISP STK500 USB ISP Programmer should do, but is there anything else I need to program the microcontrollers?
The plan is to put it in a breadboard, connect the programmer to the microscontroller and AVR Studio should do the rest?
Now there is some stuff I don't understand. Is it optional to put a bootloader on it? As I understand it you can put Arduino bootloader on both of them, making them able to run Arduino stuff which in turn could simplify the programming?
What is the process here, do I use the AVR Studio to flash both of the microcontrollers with Arduino tiny and then do the rest of the programming in Arduino?
AI: Based on your intent to use AVR Studio, I will assume you are wanting to develop in a Windows environment. Most of my recommendations below are portable to unix-y systems as well.
You should do the following:
Download / Install WinAVR
Download Eclipse IDE for C/C++ Developers
Follow instructions to install the AVR-Eclipse plugin.
Make a new project targetting your desired chip and get a blinking light working. Proceed to more advanced things from there.
You can use AVR Studio to target your chip with a hex file, or you can use avrdude to do it from the command line (the programmeres you suggested should both be viable in either case)
The concept of using a bootloader with an ATtiny is not a great idea, imho. You'll need additional support circuitry to do that (a USB to Serial converter and associated reset circuitry at least), and there is certainly some software complexity involved, as the ATtiny's don't generally have bootloader support built-in (no BOOTRST fuse for example). And you are typically already very space limited as it is. |
H: Creating a high-current bus on a PCB
I'm planning a custom power-distribution / fuse-board for in-car application, but that requires carrying high currents (50A+ @12v*) on a PCB trace. Since I'd like to keep the board cost, and physical size down, can anyone suggest efficient (as in easy & inexpensive) methods for creating a power bus on a PCB?
Feed in would be from a chunky copper cable, most likely with a screw-terminal tag on the end.
My thoughts so far:
Thick trace with thick coat of solder
Same but with some thick copper wire soldered to it
Same, but use a single strip of stripboard
A length of copper or aluminium, either attached with screws through holes in the trace, or soldered down (obviously not soldering aluminium down!)
These are all OK but require special effort to populate the board, whereas something available off-the-shelf would make life easier.
Edit to add more info: The basic layout will be a bus up the board, with feeds off for each item, each of which may draw <30A (but most of them are <10A), so per-connection there can be a little thermal relief to make life easier.
* = Average of maybe 30-40A if the cooling fan's running and all the lights are on, ~10A if not, potentially 100A max although more headroom is better.
AI: You might try searching for solderable bus bars. They come in various sizes and shapes. You can solder them down to the PCB, and they provide masses of current carrying capability. |
H: Transformerless inverter from 20*12V batteries
Is it possible to convert 240VDC from 20*12V batteries to 180VAC-240VAC pure Sine Wave?
i have an idea using H-Bridge mosfet drivers....But i have seen on web that 350Vdc is must to convert it to 240VDC...
AI: It is possible but awkward. 180 VAC RMS will have peaks of 254 V. It would be much simpler if your DC was at least that. If it were, you could use direct drive via PWM with some filtering.
Since 240 V isn't enough for the full excursion of even your minimum output, a more expensive, costly, and less efficient method will need to be used. There are various topologies for that, but without knowing constraints and tradeoffs of your particular case it is pointless to recommend something. One method boosts the DC to what is needed for the peaks, then uses direct drive from there. Another does the high frequency chopping into a transformer like a switching power supply, but the regulation level is the much slower 50 or 60 Hz desired output. Yet another way is to direct drive to whatever sine you can manage, then run that thru a transformer at the output frequency to get what you want. |
H: Device Descriptors in Serial Communication
I was wondering if there was any Descriptor part in the data packets during RS 232 based Serial Communication. If not (apparently) then how does the computer decide regarding the type of device connected.?
AI: There are no packets in traditional RS232 communication, let alone device descriptors. Neither the computer nor the device inherently know anything about each other.
Usually, the device has fixed characteristics; sometimes some of these characteristics can be modified by setting switches, moving links, choosing an appropriate cable, or judicious use of a soldering iron.
These characteristics have to be accurately matched at the computer end, when the device is installed, typically by the user reading the device manual, and modifying options, perhaps in a .ini file, or on the command line of the communications program.
Failure to communicate accurately results in an iterative process of trying different options, scratching one's head, and (often) rebooting the peripheral to clear out garbage (like thirty thousand characters misinterpreted as form feeds aka "new page" in its print buffer)
Some of the variable characteristics are:
1) baud rate. Failure to agree on this causes complete gibberish
2) Control flow. This can be :
none - transmit regardless of whether the other end is receiving or processing previous data
Software : listen for "stop" and "start" characters when transmitting. Note that failure to agree on baud rate renders this unsuccessful.
Hardware : Watch CTS and/or DTR signal lines for permission to transmit; assert RTS and/or DSR to signify readiness to receive. Note that the cable you grabbed only wires up CTS and RTS, so your equipment will be waiting for DTR for a very long time. Note also the Diablo daisywheel printer which wires one of these signals to Pin 11 unlike everything else in existence...
3) Variations in what a simple byte looks like : 7 or 8 bits, parity or not, odd or even parity (if present), 1, 1.5 or 2 stop bits afterwards.
4) Standard 25-pin D-type connectors with an apparently arbitrary mix of male and female connectors at each end of the cable, and an assortment of non-standard connectors like 9-pin D-types...
All this variability used to support an entire industry of RS232 testers and adapters...
And I haven't even mentioned the liberties sometimes taken with voltage levels.
Sometimes it feels like a miracle that anything RS232 ever worked at all... |
H: Two MinIMU-9 v2 with LPCxpresso, or Arduino Uno/Mega
I am working on a project that interfaces two IMU sensors to one microprocessor (NXP LPCxpresso). The purpose is to read both of gyro and accelero at two different place on the bodies. I have foolishly rushed to buy this product:
http://www.pololu.com/catalog/product/1268
The sad thing about it is that "The accelerometer’s slave address is fixed to 0011001b", so I cant use two different I2C addresses for two IMUs. (but it is possible in version 1 of this sensor!).
Is there anyways I can overcome this dilemma? I am also thinking about switching to MPU-6050, but sadly, I cant find a library for MPU-6050 for LPCxpresso.
Could you please giving me some suggestions?
AI: The least significant bit of the slave address is set by the SA0 pin. The last bit of the address reflects this bit. In the schematic you can see that this pin is pulled up via 4.7k to VCC. You can ground this pin to change the last bit of the address.
Look at page 23 of the L3GD20 datasheet for information on this. So in your case you will need to depopulate R6 and connect the pin to ground.
This doesn't solve the issue completely since LSM303 doesn't seem to have the same capability. The easiest way here is to connect it to a separate I2C bus if you have another one available.
An interesting option is that there are two transistors Q1 and Q2 on the board. You could disconnnect them from VCC by cutting the traces and routing to a GPIO that will select the IMU you want to talk to. |
H: Op-amp circuit works correctly only when the oscilloscope's probe is connected to it
I'm using a piezoelectric speaker as an shock sensor. I made a simple non-inverting amplifier using the MCP6021 op-amp as shown in the circuit below. I'm only interesting in the positive output of the speaker so I put a diode to protect the op-amp's input from the negative spikes.
The circuit works as expected when the the oscilloscope's probe is connected to the input (either before or after the diode). When I disconnect the probe from the input, the output of the op-amp seems the become unstable. Sometimes it oscillates at different voltage levels and sometimes it saturates at the positive rail.
What could cause this behavior?
AI: Connect a high value resistor from pin 3 = op-amp non-inverting input (OA+) to ground. 10 megohm may be OK but 1M better and lower still better still - but lower will load MK1 more.
What is [very probably] happening is that there is no DC bias to the OA+ input and in the absence of signal the very high impedance input is driven by a combination of inset-offset voltage, input bias current and the prior positive input - all stored in or charging or discharging the capacitance at OA+ to ground.
Oscilloscope probes and fingers (when connected to bodies) tend to make such arrangements work better or differently by providing a small amount of "ground reference" current or a degree of sink impedance. |
H: PCB Edge to Edge Connectors
I'm trying to find a way to connect PCB boards edge-to-edge so that I can make a "train" of PCB boards in a row.
It seems to me that this should be straight forward to do using a a female to female edge connector, but when I've looked for such a beast I've only found one solution that's both overly large and overly expensive (http://www.digikey.ca/product-detail/en/EAC10FSLN/S9348-ND/2618449?cur=USD).
Any ideas how I can best accomplish this?
AI: Use suitable male and female indirect connectors, such as those used on these boards:
The boards may be daisy-chained.
They are available from Digi-Key.
Mating connectors are on the same page. |
H: Discharging RLC. Kirchhoff's second law
I have been trying to solve this homework problem for who-knows how many hours. I could break it down enough as to specify the problem I'm facing into a single question:
For the following circuit with a charged capacitor, is \$ v_C + v_R + v_L = 0 \$ the right term? Or should it be \$ -v_C + v_R + v_L = 0 \$? Why?
I am getting really confused because everywhere, the RLC circuit is solved with a tension source, hence the formula is \$ E = v_C + v_R + v_L \$, but I have doubts if it's as simple as E = 0 since in this particular case the source itself of the power is the capacitor, entering the current through the negative side.
Keep reading only if you said the \$ v_C \$ should be negative. I explain how I tried this and didn't work at all about what I've tried in the problem and how I got to that particular question:
Here is the general circuit. The DC source charges the capacitor and in t=0 it's opened. Therefore, for all t>0, we get the simplified circuit of the previous image.
The problem considering the \$ v_C \$ negative is in the general solution of the differential equation:
From this solution, we can see that the current would increase non-stop, which doesn't make any sense (from the initial conditions \$ C_1 \neq 0 \$ and \$ C_2 \neq 0 \$). Therefore, using the right signs yelds to a wrong solution, using all v positive yelds to a good solution (both exponents negative).
AI: Label Vc and Vl in your diagram... current always flows from higher potential to lower potential (voltage). So depending on the direction your draw your current flowing, the voltage always drops in the direction of that current flow.
Simply put, in your first picture there is only one current loop. The current flowing through all the elements must be equal. I'll call the upper left corner node Vc and the upper right corner node Vl. Then namely:
(Vc - 0) / Zc = (Vl - Vc) / R = (0 - Vl) / Zl
Here Zc and Zl are the complex impedance of the capacitor and inductor respectively.
Alternatively, if we assume a current i0 is flowing through the circuit clockwise, and remember that voltage always drops across an element when current flows through it, then:
Vc = 0 - i0 * Zc
Vl = Vc - i0 * R
0 = Vl - i0 * Zl
Therefore:
0 = Vc - i0 * R - i0 * Zl = - i0 * Zc - i0 * R - i0 * Zl
Changing the sign:
i0 * Zc + i0 * R + i0 * Zl = 0
So yes, all elements should have the + sign. |
H: Eagle: Removing unwanted bits of copper pour
I have lazily made a copper pour in Eagle by highlighting a rectangle around my irregular shaped board. How do I then selectively remove the copper pour from outside the board boundary and the little unconnected pointless bits between some components?
AI: Uncheck the orphans property of the polygon.
From Eagle's General Help:
Orphans
As a polygon automatically keeps a certain distance to other
signals it can happen that the polygon is separated into a number of
smaller polygons. If such a polygon has no electrical connection to
any other (non-polygon) object of its signal, the user might want it
to disappear. With the parameter Orphans = Off [default] these
isolated zones will disappear. With Orphans = On they will remain. If
a signal consists only of polygons and has no other electrically
connected objects, all polygon parts will remain, independent of the
setting of the Orphans parameter. |
H: Atmega 8 is not programming once it is set to external crystal?
I am using Asim Khan's Parallel port Programmer to program my AVR ATmega8 controller. The Problem is when I changes fuse bits to external high speed crystal, then the next time programmer does not detects the programmer. I am really frustrated to figure out what would be the problem. Can any one helps me to locate the problem?
Thanks in advance
AI: Assuming you set the correct fuses, the crystal may not start oscillating because of wrong feedback capacitor values. The "correct value" depends on the load capacitance of the crystal.
See that
you have properly connected external feedback capacitors
the capacitors have the recommended value (refer to uC and crystal data sheets)
the PCB traces are as short as possible (long traces introduce a parasitic capacitance and high impedance)
try setting CKOPT fuse (from mega8 data sheet: "When CKOPT is unprogrammed, the Oscillator has a smaller output swing. This reduces power consumption considerably. This mode has a limited frequency range...") |
H: Sync 12 Arduinos - I2C vs Serial
I've been given 12 arduinos (Mega) and 12 breakout boards (custom built. they pump up the output of the digital pins to 12v @120mA) to control around 300 LEDs. I'm using a pseudo PWM library to fade the LEDs.
This could have been achieved with a much, much cheaper setup. Open to suggestions, but time is of the essence.
My quandary is getting all these micro controllers synced. I've never been involved in a project where timing was so significant; I would usually use the TX/RX serial pins to just relay commands out, but I'd sleep better at night if there was some kind of heartbeat from a master to 11 slaves. Is I2C the way to go in this case, or do I look at alternatives?
tl;dr
Whats the best way to keep 12 arduinos in sync?
AI: Use two pins per chip an input and an output and chain them together serially. Have the "master" chip drive the toggle the pin each 'frame' and all the slaves interrupt on pin change, register the heartbeat event and 'sync', then propagate the pin state to the next chip, and so on... if you want to get fancy, wrap the output of the last chip in the chain back to the master so that the master can determine whether the message was received and what the latency of that response was.
This is a nice, simple approach that doesn't require a lot of software sophistication or much worry about electrical characteristics and signal integrity. There are, obviously, other more complex and feature rich approaches to solving the problem you pose. |
H: What are FIT's and how they used in reliability calculations?
In Military, Medical, Space, Professional eqt. design there is a need to be able to prove that your device can last a certain length of time with a certain confidence level. Or that reliability must be used in design to inform the design direction, either through component selection, component testing and sort or in amelioration techniques (like redundancy, FEC's - Forward Error Correction etc.).
How are FIT's (Failure In Time) used in the reliability aspect of design and verification? Examples of calculations?
How are FIT's determined/derived?
How is this related to MTTF (Mean Time To Failure) and MTBF (Mean Time Between Failures)
AI: The term FIT (failure in time) is defined as a failure rate of 1 per billion hours. A component having a failure rate of 1 FIT is equivalent to having an MTBF of 1 billion hours. Most components have failure rates measured in 100's and 1000's of FITs. For components, such as transistors and ICs, the manufacturer will test a large lot over a period of time to determine the failure rate. If 1000 components are tested for 1000 hours, then that is considered to be equivalent to 1,000,000 hours of test time. There are standard formulas that convert the number of failures in a given test time to MTBF for a selected confidence level. For a system of components, one method of predicting the MTBF is to add the failure rates of each component and then taking the reciprocal. For example, if one component has a failure rate of 100 FITs, another 200 FITs and another 300 FITs, then the total failure rate is 600 FITs and the MTBF is 1.67 million hours. For military systems, the failure rates of each component can be found in MIL-HDBK-217. This document includes formulas to account for environmental and usage conditions such as temperature, shock, fixed or mobile equipment, etc. In initial stages of a design, these calculations are useful in determining the overall reliability of a design(to compare with the specified requirement) and which components are most significant in terms of the system reliability so that design changes can be made if deemed necessary. However, component reliability is more of an art than a science. Many components are so reliable that it is difficult to accumulate enough test time to get a good handle on their MTBF. Also, relating data taken at one set of conditions (temperature, humidity, voltage, current, etc.) to another is open to large errors. As already mentioned in the comments, all of these calculations are mean numbers and are useful in predicting the reliability of a large number of components and systems, but not any individual unit. |
H: Why is silicon used to make microchips?
On my quest to better understand how computers work at a deep level I have come to the question of why, exactly, silicon is used in microchips. I always assumed, naively, that silicon had a very high electrical resistance and so it made a good material to sandwich other materials with low electrical resistance (i.e. gold) in. And that this was the way that microchips were made.
After actually doing some research I see that I was wrong and that silicon is a 'semiconductor'. To keep this short I'll just skip forward and just say that I don't understand what a semiconductor is and why it's good for making microchips. I've seen several explanations and they either confused me, or the explanations completely contradicted each other, but the basic gist is that a semiconductor is somewhere in-between a conductor and an insulator. Why is that useful for making integrated circuits?
AI: Any of a number of semiconductor materials can be and are used, indeed the first transistor was actually a Germanium (Ge) transistor. the real reason why Si is so dominant comes down to 4 principal reasons ( but #1 is the primary reason):
1) It forms an oxide that is of very high high quality, seals the surface with very few pin holes or gaps.
- this allows gap MOSFET to be more easily made as the SiO2 forms the insulating layer for the Gate,
- SiO2 has been called the chip designers friend.
2) It forms a very tough Nitride, Si3N4 Silicon Nitride forms a very high bandgap insulator which is impermeable.
- this is used to passivate (seal) the die.
- this also used to make hard masks and in other process steps
3) Si has a very nice bandgap of ~ 1.12 eV, not too high so that room temperature can't ionize it, and not so low that it has to high leakage current.
4) it forms a very nice gate material. Most modern FET's used in VLSI (up until the latest generations) have been called MOSFET but in actual fact have used Si as the gate material. It turns out that it is very easy to deposited non-crystalline Si on surfaces and it is easily etched to great precision.
Basically the success of Si is the success of MOSFET, which with scaling and extreme integration has driven the industry. Mosfet's are not so easily manufactured in other material systems, and you can't drive the same level of integration in other semicondcutors.
GeO2 - is partially soluble
GaAs - does not form a oxide
CO2 - is a gas
Semiconductors are used because with selective contamination (called dopants) you can control the properties of the material and tailor it's operation and operational mechanisms. |
H: LiPo discharge circuit doesn't work
A friend of mine gave me this circuit to discharge a 3V7, 5000mAh single-cell LiPoly accu:
simulate this circuit – Schematic created using CircuitLab
The zener is to make sure that the circuit stops when the voltage gets below 2V7, so that the accu doesn't get below the critical voltage of 2V4.
However, this doesn't work. The voltage over the zener is approximately 1V, the voltage over the resistor 2V7. Now the resistor gets a little warm, but more important, the circuit won't stop at 2V7 but at 1V. Am I right?
How can I change the circuit to make it work?
AI: You have to connect the zener reversed. Cathode of the zener must connect to the positive terminal of the battery.
Zener voltage of the zener diode is only effective in the reverse direction. In this connection it works like a regular diode. |
H: Inexpensive multimeter for integrated current measurement
I'm building a simple circuit with an Arduino Nano board, which will read signals from a Hall sensor and periodically send pulses to a small 5V solenoid. I'll drive it from 6xAA batteries in series, producing 7.2V. The on-time of the solenoid will be very short, and with a small duty cycle that will vary quite a bit (say 1% to 10%). I find here that the solenoid consumes 240mA at 5V if always on, and I guess the board and other bits-n-pieces would add another 50mA?
So, I'd like to be able to measure the current consumption over a set time period, such as a minute or five minutes - with an end goal of reducing the ongoing consumption (I'd like to use 6xAAA batteries, but AAs may be necessary, depending on how low I can push the current draw). However, with the current varying wildly over time, it is hard to get a static readout from my digital ammeter (it takes a good few seconds to settle) and they generally will change frequently (<0.1 sec).
A bit of research shows that I need an integrated ammeter, i.e. an ammeter that integrates over time as here. This question here is interesting, but answers recommend building such a device with an Arduino! I wonder, can such a thing be purchased inexpensively, ready-made?
AI: I agree that the oscilloscope is a better solution for this sort of thing.
If you want to measure current consumption over periods of a few seconds or minutes, though, you could try building something using a coloumb counting IC like the DS2780. It may be possible to use it for something like this, given that measuring consumption accurately is it's primary task. Some creative repurposing may be involved, since they're designed to track battery energy status and therefore have registers and outputs and algorithms designed for that sort of use. Still, though, you'd need to use an arduino or such to interface with it anyway. |
H: Any disadvantages to single-supply mode?
I am using the ATMEL ARM SAM4S MCU for a project. It supports a single-supply mode where an internal voltage regulator provides the 1.08-1.32V necessary for VDDCORE and we need only provide 1.62-3.6V to VDDIO.
I'm just interested to know if there is any situation where one might NOT take advantage of this feature and supply the core externally as well?
AI: The main reason would be for power efficiency. The voltage regulator inside the chip is a linear one, which means that its efficiency is: (VDDCORE/VDDIO). So if your VDDIO is 3.6v, then your efficiency might be only 33%! This is a terrible waste of energy, especially in a battery powered portable device where a long battery life is an important selling point for the device.
Poor power efficiency not only leads to a shorter battery life, it also generates heat. In this case it doesn't seem like much, but it can make all the difference. In a hot environment, that extra heat might push the chip over its specified operating conditions, leading to failure. In some applications, you might have lots of chips, which could create quite a lot of heat. In one application, we had 20 ET1200 chips, all using their internal regulators. Each chip's core uses just 75mA. But 20 chips means 1.5A on the cores, and a total of 1.2W of power dissipated just as wasted heat. The inside of the enclosure got pretty hot. |
H: SU-48 footprint
This datasheet specifies the packages for the components, but not the associated footprints.
The package of interest for me is SU-48. The obvious search brings me to this outline, but still no footprint.
Where can I find footprint information for the SU-48 package?
AI: Despite what Olin says, it's actually not unusual at all for datasheets to provide footprints. It's the first place I look. However, this part comes in standard TQFP and LFCPS packages, and either your PCB software can generate these with a wizard (Altium does) or you can look up the footprint online:
Microchip Packaging Specification document has some.
The key thing you want to search for is TQFP or LFCPS (depending on the package you choose). |
H: magnetic field outside solenoid
It is written in our course book that the magnetic field outside a solenoid is negligible and almost zero. Why is it negligible? Is it negligible compared to the field inside solenoid or is it nearly equal to zero?
AI: A simple model to help you visualize: The magnetic flux forms loops, you cannot have a magnetic field line terminate on nothing in free space. That means that all those flux lines inside the solenoid heading (for example) to the right. The flux line must continue outside the solenoid and loop around to join the other end of the flux loop. In doing so it heads to the left. No external flux lines -> no flux.
So what could be the issue?
1) In an infinite solenoid, there is no external magnetic field. One example of this is a Tokamak or toroidal solenoid. Like a big doughnut. The flux lines form loops within the doughnut and have no need to go outside.
- of course a mathematically ideal infinite solenoid could have been what they were discussing, in which case the field lines loop around infinity. Hard to test though.
2) The flux density outside of the linear finite solenoid is much less than inside. So while there may be X flux across the throat of the solenoid that same amount of flux (X) is spread out over a much much larger cross sectional area. The density is much less. [here the area is the cross sectional area across the solenoid.]
3) Perhaps they are talking about a shielded solenoid? This would involve having a high permittivity material external to the coils to trap the flux lines. |
H: How can I switch a high current with a low-rated switch?
I'm designing and building a breadboard power supply for myself, which draws power from an ATX-like SMPS (Mains in, single Molex plug out) via a 4-pin Molex connector. The design includes a switch to select either 12V or 5V output, but the only appropriate switch I can source is rated for a paltry 30mA!
Obviously I can't switch up to 2A with a 30mA-rated switch, but what can I do (that's cheaper than the ~$5-10 local vendors want for 2A-rated switches)? I thought of using an NPN transistor (see diagram, below), but in simulations that resulted in an unwanted voltage drop, and having the load connected to both emitters seemed to do weird things to the voltage.
simulate this circuit – Schematic created using CircuitLab
(Note: Q1 & Q2 are generic NPN transistors, I've not considered part specifics yet.)
I thought of perhaps using a MOSFET, but decided that since I really don't know what I'm doing, asking for help was perhaps an even better idea.
AI: To return to your transistor solution (as others have opted for a different mechanical switch), it might look like this. I included Wouter's hint for using a diode instead of the second transistor. Also I changed the bipolar transistor to a MOSFET. Reason for a MOSFET is because the base current of a bipolar transistor gets rather high with regular power transistors. Reason for P-channel high side switching is that this way the load can be attached to ground. If this is not a requirement, the circuit can be slightly changed to support an N-channel MOSFET.
D1 should be rated > 2A
T1 should be rated Id > 2A (P-MOSFET)
simulate this circuit – Schematic created using CircuitLab |
H: symbols for ep3c5e144 and ep3c25e144 in Eagle
I am using ep3c5e144 to design a PCB board. Sadly, in Eagle I cant find the exact library and symbol for this device, but only its near relative ep3c25e144.
I have some questions:
How different is the pinning for ep3c5e144 and ep3c25e144? Can I reuse the symbols of ep3c25e144 for my design?
Where can I find more about the information for ep3c25e144?
Sorry for such amateurish question, but I am a beginner. I have many confusions: for example, the VCC , should I connect them to 3.3V or 1.2V? There are 16 clocks, should I connect all of them?
Thank you so much for your help!
AI: You can find Cyclone III documentation on this page.
In device handbook, look for "Table 1-2" (p.16). This table shows all available vertical migration options for Cyclone III family. "Vertical migration" means that when you design your board for one particular FPGA, you can replace this fpga with a higher density one (which has all the same pin layout etc.).
According to this table for E144 package EP3C5 and EP3C25 are compatible so you can use device symbol for EP3C5 instead of EP3C25. |
H: What makes intel capable of very high clock rates?
What are the determining factors responsible for why Intel chips can clock at 4Ghz or higher speeds, while other processors such as ARM can't? Is it because Intel's state of the art fabs or is it the architecture of the x86? It hard to understand how a complex chip like the i7 can clock so high.
AI: The main reason why ARM processors are not clocked at 4GHz is power consumption. Architecture, fabrication, etc do play a big role, but the reality is that a tablet or mobile phone needs to last as much as it can off a battery, so all those factors are designed so that power consumption will be minimized. When going for lower power consumption, you sacrifice performance because of design choices in the node, architecture etc. Higher frequency is a battery killer because:
P = CV2f
Where C is a capacitance, V is the voltage, and f is the frequency. So it varies linearly with frequency, and it's why frequency scaling is so prevalent, even in laptops. |
H: create Eagle library for bsdl file
I am designing a PCB Board for Altera Cyclone III EP3C5E144. However, I cant find any library for this device in Eagle.
Is there anyways I could create the library and symbol for this device, based on this bsdl file?
http://bsdl.info/view.htm?sid=599926c619a107a388ca59b002289d77
AI: Eagle comes with an ULP for this. It's called "make-symbol-device-package-bsdl.ulp" .
Open a new library file. From menu click File->Run, select make-symbol-device-package-bsdl.ulp . Click Browse, find your *.bsdl file. Rest should be easy.. |
H: Considerations For Motor Cables: what are the downsides to ribbon cable?
My friend (a Mechanical Engineering student) is building machine that uses an array of motors in an application where they are under almost no load. He showed me the thin, old, ribbon cable he intends to use to power them, and it seemed like a bad idea to me.
The thing is, although I am an Electrical and Computer Engineering student, I have very little background in power systems and electromagnetism. It seems like using flimsy and thin ribbon cable to supply power to a motor is a bad choice, but aside from it possibly breaking from being a little brittle, I can't justify why. It just seems wrong.
So my question is, what are the limitations that these little ribbon cables are putting on the motors? Am I just being snobbish or is there a compelling reason beyond mechanical concerns why they are a bad choice?
Edit: The first answer to this post pointed out some of the possible advantages to ribbon cable. Thanks! In the specific case I was taking about, my friend is just using two lines on the cable for the positive and ground of each motor, but using several lines on each cable makes a lot of sense and had not occurred to me before.
AI: array of motors ... under almost no load
Depending on the motor, even under low load current draw can be substantial. The current draw will of course increase under load, more so in stall conditions.
using flimsy old ribbon cable to supply power to a motor is a bad choice
Not necessarily true: Inside your CD ROM drive you may well find motors with a full load current flowing through FPC / FFC connections along the way, even flimsier than a ribbon cable. It depends on the current drawn and the rotation and PWM frequencies (where applicable).
Also, hard disc drives (not SSDs) have motors with substantial spin-up current requirements, and their supply current comes in via the same ribbon cables (IDE cables, for instance).
is there a compelling reason beyond mechanical concerns
There is, if the motor is being controlled via a very high frequency PWM signal, or is itself a high speed motor: The signals would radiate EMI, if not shielded - The recommendation in such cases would be shielded twisted pairs, at the extreme. However, for a hobby project such a consideration is most likely maximum overkill.
Conclusion: If the ribbon can handle the current, nothing wrong with using it. |
H: powering a fan with ATX PSU 5v standby when off, with 12v when on
Using an ATX PSU, how would I design a circuit to power a load (dc fan) with 5v standby when PSU is off, and with 12v when PSU is on. I want to control (on/off or pwm, it should not matter?) the fan from a 3.3v mcu (powered with standby 5v) using a single pin. I guess it will require at least 2 P-mosfets, resistors on gates side and flyback diode across fan, but can't find how to do it cleverly without extra "logic" on both gates sides.
AI: A diode from 12V and a diode from 5V standby to the fan provides powering you require.
Then PWM as desired (single FET or transistor plus diode across the fan).
Note that you CANNOT with certainty reliably speed control a brushless DC motor this way.
No, that was not a typo - 'with certainty' and 'reliably' both belong.
Note that most small fans that you will encounter will use brushless DC motors (BLDC motors).
If a BLDC motor controller is designed to operate it at the max speed that it will run at on a given voltage
AND IF it will run on say 4.5V to 12V
AND IF your PWM is arranged to supply a DC voltage that is ripple free enough not to aggravate the controller, then it will probably work OK.
If any of these is not true then it may work badly in some ranges or not at all. |
H: how to wire up LIS302DLH with arduino? (or similar, small accelerometer)
heads up: I'm new to electronics and have just started working with the arduino.
I'm trying to hook up a LIS302DLH accelerometer (spec sheet) with the arduino. I've successfully managed to get the adxl335 (e.g. link) to work but the adxl335 is too big for my application. That's why I was looking into the LIS302DLH. Unfortunately, I don't know how to hook it up.
Therefore my question: how to I hook up the LIS302DLH with the arduino? Do alternative small accelerometers exist that might do the job?
EDIT what want to know is how to connect (wire up) the LIS302DLH with the arduino. which pin needs to be connected to what?
AI: Note: The specified accelerometer operates up to 3.6 Volts, so it will require level translation to work with one of the classic (5 Volts) Arduinos. If the Arduino you are using is one of the newer 3.3 Volt boards, then this level translation is not required.
For level translation information, you will find many related questions in this site, so this answer does not cover it.
For pin to pin connecting up, using SPI mode:
Sensor pin 07 to Arduino SS Slave pin (slave select, drive low to communicate)
Sensor pin 12 to Arduino MISO pin
Sensor pin 13 to Arduino MOSI pin
Sensor pin 14 to Arduino SCK pin
Sensor pin 08 to any free Arduino interrupt enabled pin, use digital pin 2
Sensor pin 09 to any other Arduino interrupt enabled pin, use digital pin 3
The MISO/MISO/SCK/SS default pins for various Arduino boards, from the Arduino SPI reference, are given below:
Some of the SPI pins are available on the ICSP header on all Arduino boards, for consistency:
For the SS and interrupt pins, any free digital IO pins on the Arduino may be used, no specific standards need to be followed.
The I2C method of connection is best avoided for this part, as the I2C bus speed limitation will give marginal results. |
H: Open loop op-amp white noise difference amplifier
I want to amplify the noise generated by a MAX8069 voltage reference, using direct coupling in order to preserve the low frequency components. The frequency band of interest is from 1Hz to 44Khz. I'd like to be able to measure the power spectrum at different frequencies, so minimising filtering and distortion is important. The output of the op-amp will go to the input of an AVR ADC, which is high impedance. The application is a random number generator.
I had the idea of measuring the difference between two similar noise sources; this should yield plenty of noise whilst allowing the direct coupled design.
The op-amp chosen is LM358, noise is supplied into both inputs from two 1.22v MAX8069 voltage references. These should generate around 20µV noise. Supply voltage is 5v and current into each reference is limited to around 1ma by 3k3 resistors. This should maximise the noise each reference generates - see Terry Ritter's junction noise measurements.
The expected behaviour is to see large voltage noise at the output of the op-amp. What I'm actually seeing is the output steady at 3.75v. This changes to 3.8v if the inputs are swapped.
Schematic http://a.yfrog.com/img741/1007/af9qy.jpg
What is the explanation for the fixed output voltage, and what modifications would be needed to see the expected behaviour?
AI: Too much gain. The amp is open-loop so its gain will be about 100,000. Any difference between the source voltages, even 1mv, will cause the output to clip (settle as close as it can get to one of the supply rails).
Look for examples how to set the opamp gain to something more reasonable (say 100 or 1000) such as the "non-inverting" amplifier here. With Rf= 100k and Rg=1k, gain would be a reasonable 101. You will also only need one of your noise source inputs.
One warning about excessively high gain from an opamp : bandwidth is reduced (see "open loop bandwidth" and "gain/bandwidth product" aka "unity gain bandwidth") so noise from such an amplifier will not be "white" (spectrally flat). You need to decide the bandwidth you need and set the gain accordingly. For an ADC, bandwidth is usually less than half of the sample rate. For white noise, we probably don't need to be as strict as we would for general signals, but still, a bandwidth of 30kHz is reasonable given your 77kHz limit on sample rate.
For a TL082, unity gain bandwidth is specified as 3 MHz, so that limits our gain to 3MHz/30kHz = 100 for a single amplifier stage. You can choose a faster opamp, or add a second amplifier stage for higher gain. (However, it can be difficult to stop a high gain, high bandwidth amplifier from oscillating)
You may want to control the DC gain separately from the AC gain, and set the DC gain to a lower value such as 1. This is easily done with a capacitor (say 10 to 100 uf) in series with Rg. Then you can increase Rf to increase gain without the output clipping from DC imbalance (but at the cost of reduced bandwidth).
EDIT: Simple capacitor coupling would reduce the DC gain to 0. This approach has a DC gain of one, easily increased with a resistor across the capacitor, to some intermediate value. Either approach works.
You can employ higher order filters to improve the response around your chosen cutoff point; at the moment I think it adds complexity. Or you could set the cutoff to 0.1 Hz, but I think you would have to wait about a minute before it settled after power up! |
H: What's the input resistance of an opto-isolator?
I need to sense if a 48 volt power supply is supplying voltage or not, I plan on doing this with a opto-isolator and I am happy with the output circuit from isolator.
Can I connect the input of the isolator between 48 and 0 volts, or do I need to add in a extra resistive load to avoid a shortcircuit style scenario?
AI: You need to look at how much input current your optoisolator needs, and then use a resistor that passes that amount of current when it has 48V across it.
Technically, you should first subtract the voltage drop of the optoisolator from the supply voltage, but in this case, the difference should be negligible.
For example, if your isolator needs 10 mA, you would select a resistor of 4700 Ω, which is the closest standard value to 48V / 0.01A = 4800 Ω. Note that this resistor will be dissipating 48V × 0.01A = 0.48W, so select a 1W resistor for good reliability. |
H: What does a beginner need to know to build a programmable heater based on resistance heating?
To build a programmable deep fryer, as a learning project for more serious checmical reactors, I need to build a programmable heat source that can be controlled in response to sensor readings and a schedule. I'm a programmer and I have some metalworking skills that I am currently expanding on, but my knowledge on electronics is basic at best.
I'm pretty much in love with induction heating, but I was advised on this question that it might not be the wisest choice to start with, so let's try resistance heating first.
AI: Actually, a beginner doesn't need to know much at all. You can buy the control system off the shelf.
This is an Industrial Temperature Controller. You simply connect up the temperature sensor, an solid state relay (they often come with both of these). Let it run through its learning cycle. Then you program in the temperature you want, and watch it automatically control your deep fat to the temperature you want.
They're available for very little money on eBay. They solid state relay it comes with is good for 10A (2.5kW heater). |
H: Can I add resistors?
How can I achieve 10k resistance?
I just got my photocell in the mail, totally forgot the 10k resistor. The thing is I have a lot of different resistors in the span 1, 10, 27, 37,56, 68, 82, 100.
Is there a way I can put them in parallel/series and make a 10k? Or do I need a 10k? How does it work?
AI: You can add resistors in series to obtain the sum of their resistances. However, from the list provided, unless you missed the "k" on some of them, it will be quite a lot of resistors in series to achieve 10k Ohms of resistance. |
H: How does an AND gate behave in this situation?
I'm a beginner and I want to know how a logic gate circuit works:
Will the led turn on just when I press the 2 switches? Or I'm doing something wrong?
AI: The AND gate has a truth table that looks like this:
Input A | Input B | Output
0 | 0 | 0
0 | 1 | 0
1 | 0 | 0
1 | 1 | 1
So when both switches are on the output will be high. This circuit could be designed better for example using a resistor to limit the current flowing through the Light Emitting Diode (LED), and tying the inputs to either V+ or ground. So that you get more reliable operation.
An example would look like this:
simulate this circuit – Schematic created using CircuitLab |
H: Solder Mask Color Code
Is there standard that recommend guidance of particular colors of solder mask?
A while back I was told by a local assembler that BLUE typically indicates the circuit is ROHS compliant. Yet my Google foo does not find any supporting evidence. Were my Google foo is swamped. So there may be something I just don't see.
AI: The soldermask color is purely a function of designer preference, and whether the person paying for the boards is willing to foot the bill for custom soldermask colors. It has no relation to whether the board is ROHS compliant or anything else.
Green is the most common just because it's a defacto standard. You can get ROHS and non-ROHS green boards, as you can with any other coloring.
It's worth noting that it's entirely possible that that assembler only had an in-house standard where they ordered boards that needed to be ROHS compliant with a blue soldermask, and boards that didn't need to be ROHS with green (or any other color) soldermask. However, that would be a function of that assembler in particular, not an industry wide thing. |
H: Minimizing Karnaugh map
I have the following Karnaugh map's for JK flip flops. I've attempted to minimize them myself, however whenever I go to implement them I run in to an error. Anyone able to see if I've made an error in my minimization.
(originally uploaded to jsfiddle)
Hope you can help, hope this is the correct place to post!
AI: Assuming that \$\Phi\$ is the same as X (don't care), I would make the following corrections:
JA = ¬B ¬C ¬D
Here you covered a 0 that you shouldn't, so you have to make a smaller minterm.
KA = D
Here you can make a bigger minterm because the 2*2 are above the minterm only contains don't cares.
KC = ¬D
Again, you can meg a bigger minterm. You don't have to add C because the first column only contains don't cares and ¬D covers the first and the last column. |
H: How to find currents of all nodes using superposition theorem
Given this circuit:
simulate this circuit – Schematic created using CircuitLab
Using the superposition theorem, I need to find the current of all the 3 nodes of the circuit.
Using superposition I've found that the current from the source:
V1 is 6.32A = i_1
V2 is 1.05A = i_2
V3 is 1.89A = i_3
So is it correct to say that at the node of V1 the current is i_1 - i_3 ?
I am really not sure how to proceed.
AI: You have found the total current when you short out any two voltage sources, but you also need the current going the other branches of the circuit.
your i_1 is i11, your i_2 is i22 in the diagrams above.
After you have solved the circuit for each source individually you can add together the currents of each branch to get the total current of the final circuit with all sources.
So the current through V1 with all sources would be i11+i21+i31. You can then use the total current to find any voltage drops you need.
Pervious:
I it is not possible, with out solving the circuit in some fashion to know the directions of current you are taking about in your questions. It would be a good idea to include a diagram like on fo the below or add an up/down, left/right annotation to your current where appropriate.
You can draw your current arrows in any direction you want, if the current is actually flowing in the opposite direction of your arrow then then it will just end up being a negative current in your solution.
example diagrams: |
H: SSC-32, can I and how can i program it
A friend recently gave me this board that he had never used and didn't know anything about it. It had a USB to serial cable plugged into it with the driver software that I installed and it had a servo motor included. Question 1- is this a micro controller (i know it has something to do with servo motors but is it programmable?)? Question 2- if this is programmable how can i program it (what language, what tools) and if so can i UNPLUG it from the computer and still have it run (flash memory or something like that) And last, does this have inputs (digital, analog) so I can perform actions based on the inputs? i notice some pins in the middle that don't look like they are for servos.
AI: The SSC-32 is a dedicated servomotor controller with an embedded microcontroller in it, the ATmega168.
Answer 1: It has a microcontroller, and thus is a microcontroller board.
The microcontroller on this can be reprogrammed - ICSP pins are accessible on the board, though not in a convenient ICSP header. However, it comes preprogrammed with serial interface and servo control logic, changing the programming will eliminate the purpose of this board.
Answer 2: You can program it in C using AVR-GCC, or any of a host of other programming tools that support Atmel ATmega microcontrollers. You will also require a programmer device, one that supports ICSP.
Yes, the board can operate when unplugged from the computer, so long as an appropriate power source is provided to it. The microcontroller internally contains Flash memory, as well as RAM and EEPROM storage. See the datasheet linked above for details.
Last: The microcontroller does have both analog and digital input/output pins, but they may not all be conveniently broken out to pins on the board. So yes, if you sacrifice the Servo Controller function of the board, you can use it to perform actions based on inputs.
Those pins you notice in the middle are, in fact, input pins used by the default programming to trigger servo related functions. |
H: How do I make a micro-controller act as a finger on a touch screen?
I want to make a device that I can place on a capacitive touch screen and it will start tapping the screen repeatedly. Is there any way to do this with the Arduino?
AI: This can be done if you get an Arduino plus a servo controller that has a rig that controls a stylus. The stylus must be able to work with capacitive touch screen (not all do).
Look for Arduino Servo Controller shield |
H: An opto-coupler/triac oddity -- is it a problem, and is there a solution?
I'm using VO2223A opto-coupler/phototriacs to drive some low-current mains lighting with a PIC controller. All are working fine, but when the (DPST) mains switch is first turned on during system power-up), on 50% of occasions the lamps will briefly flash, even though the PIC control inputs on the chips are being held low. (Even grounding these inputs as a test has no effect on this flash.)
Why are the power triacs being triggered? Is there a voltage surge? And is this potentially damaging to the V02223As?
If it is a potential problem, is there a way of softening the initial power-up, raising the voltage more gently, and preventing this somewhat disconcerting flash (of 35 lamps...)? Many thanks.
AI: I suspect the issue here is that the triac part of the VO2223A is triggering due to a transient pulse at its input which occurs when turning on your main power switch. With ordinary triacs, the general problem of transients triggering triacs is treated with what's called a "snubber network". I assume the problem would also occur in an optocoupler triac too, even though it doesn't have a gate wired up.
This application note describes the problem, with some example solutions. http://www.fairchildsemi.com/an/AN/AN-3008.pdf. (You can probably google for other sources on this same topic, and there may be app notes that pertain specifically to optocoupled triacs).
One item that the paper mentions is that the problem is worst when the triac starts off in the state where no power is applied, as that is when the "collector to gate" (in the 2-transistor equivalant model) capacitance is greatest, and thus quite effectively couples the pulse from you turning on the switch into the gate, turning on the triac, at least for one half cycle.
I would not expect this to harm the devices, as this is just "normal operation" albeit for a very short time. |
H: What is this IC marked IA89G or 1A89G?
Please I need a bit of your help. Do you know what IC is this marked IA89G or 1A89G perhaps? I've tried Googling but to no avail. I'm really wondering why this is such a hard nut to crack.
Here are a few snapshots of the IC:
Thanks a lot!
Joemill
AI: Much as it might look like the CAT37 label on the PCB means "CAT component 37", it appears that it's actually an LED driver boost converter:
http://www.onsemi.com/PowerSolutions/product.do?id=CAT37
And FWIW, this converter looks like it's intended to power 4 white LEDs, so perhaps your tester equipment has a display with white backlight, or is able to test the backlights of LCDs under test? |
H: Build an Audio Toggle Box
I want to build a small box with two audio inputs and two audio outputs, with two switches to control the current input/output. Something like this: http://www.youtube.com/watch?v=mQzLnt0_-zU
I've wired up the following diagram in CircuitLab for how I think this should work:
https://www.circuitlab.com/circuit/4nq8kz/audio-toggle-box/
Do I have it right? Am I missing something? How can I add some LEDs to show which audio source/output is current? I was thinking I could probably power some small LEDs directly off the audio sources with a diode and/or capacitor to smooth out the AC audio, does that make sense?
AI: First, I'm assuming that the speakers you show have their own power and amplification, so that throughout your schematic we're dealing with low-level audio signals, right? Ie: you're not hoping that the PC output will drive raw speakers?
Assuming this is correct, your schematic looks like it does what you describe, but here's a thought. As you have it wired, you are committed to using only the speakers or the headphones, but not both at once. You couldn't listen to the ipod on the headphones while the PC sends its sound to the speakers, for example.
Instead, consider wiring up two parallel "copies" of SW1, where the output of one of the "SW1"s is wired direct to the speakers (possibly through a jack) and the other "SW1" has its output direct to the headphones. Essentially these SW1s function as input selectors for the speakers and headphones respectively. It won't be a problem if both select to listen to the PC, or both the ipod.
As for driving LEDs off the audio signal, this will not be satisfactory. An LED needs at least 1.4 to 2V to illuminate, which your audio will be below much of the time. In addition, when lit the LED will draw more current than the low level audio signal can provide (without distorting the signal a lot).
You might consider replacing the DPDT switches with DP-3-throw switches, and use the extra throw to control LEDs. You could conveniently get power from the computer USB jack. Use 150 to 300 ohm resistor in series with the LED to operate off 5V -- adjust to suit your taste for brightness. |
H: Receiving videos via wifi
I'm working on a electrical board that should receive videos from a server via WIFI. The size of the video is around 100 MB..it will be stored afterwards into an SD card ...so my question is what WIFI module should i use for this type of data?
AI: The file size won't matter per se, it's the performance you require that will lead your design decision. A small microcontroller solution, such as an Arduino / AVR has SD Card and FAT libraries available and any compatible WiFi module will do the job. However you are only likely to get about a few MB/s at best through such a system, so your file may take a minute or two at best to transfer.
For higher performance probably the best choice is to use a Linux based ARM system that will probably have a dedicated SD and USB controllers with DMA and a clock speed more like 400MHz. You also get the benefit of very robust host drivers and would be able to use a mass produced WiFi dongle (or equivalent chipset) rather than something with an embedded TCP stack.
Really whichever way you go the likely easiest / best solution for a custom design is to look around at reference designs or open source projects and do what they do. As an added bonus you can also check reliability and performance of the combination before committing to your own design. |
H: Dimensions of SO8W package footprint
I'm looking for the pad dimensions and land patterns for the SO8W package. This page has drawings of many SO footprints, but no dimensions.
Where can I find dimensions for the SO8W package's PCB footprint?
AI: The SO8W (Wide) package dimensions are as follows:
For confirmation, the datasheet of the specific part would be of value.
For land pattern and pad dimensions, just use a SO8N package layout, and split it down the middle to fit the wide package.
For a comprehensive list of package dimensions, see this link. |
H: Replacing an illuminated rocker switch with 2 terminals
I am trying to replace a burnt out illuminated rocker switch in an electric fireplace heater. I ordered a replacement switch that looked like it would do the trick, but failed to notice that it had three terminals, while the original switch has only two.
There is no pinout on the datasheet, the terminals are simply labelled 1, 2, and 3. I looked into this and the third terminal is usually ground, without which the switch won't light up.
Is it safe to ignore ground / bend it out of the way? As you can tell by the linked picture, there is no way I'll be able to plug in the wires with the close arrangement of terminals on the new switch. The light won't work but I can live with that. Or would I have to find and order a two terminal rocker switch?
AI: The replacement switch is a Single Pole Single Throw switch, just like the original. However, the bottom terminal connects the illumination light, unlike in the original where the illumination switching is internal.
From the datasheet it appears that the function of the middle and upper terminals are the same as the middle and lower on the original switch. This is easy verified using a multimeter, or a continuity tester of some sort.
(You can jury-rig a continuity tester by opening up a simple torch, and using its bulb, and its batteries, hooked up with a couple of pieces of wire via the switch terminals.)
Once this is confirmed, you could try bending the illuminator terminal (either the top or the bottom one, whichever is the illumination tab as verified above) out of the way and covering it thoroughly with insulating tape, then wiring up the switch just as the original was, with the center and the remaining end terminal.
Making the illumination work would need an additional piece of wire between the top and bottom terminal, properly insulated after hooking up, of course. This may best be left for a more experienced person to deal with.
For those who haven't examined the image posted in the question as the "original switch", here is a straightened, cropped, image-enhanced version of the switch, clearly stating "16A 250V AC".
This is why the solution given above is clearly valid. |
H: Writing a driver for a wireless usb dongle for an AVR microcontroller
I have an avr micro-controller which supports USB OTG. I also have a wifi usb dongle which connects to the internet. I need to write the required drivers in order to interface this usb dongle with a wifi module. What books would be the right starting point. Could someone please point me in the direction of some good tutorials for achieving this.
AI: You will have to get a USB sniffer to be able to sniff the protocol. Otherwise, even if you have a USB stack, you won't know what kind of data to send and receive. Moreover, the driver required to run the USB dongle is likely to be very large, perhaps too large to fit in the AVR micro's flash. I recommend that you pick up a ready made module such as TI's CC3000 or another one.
For USB a good reference is USB Complete
[Edit]: I really recommend you look at TI's CC3000 module. It's throughput can reach 4Mbps, and this is what you should expect from a microcontroller based solution. |
H: Wiring a SPDT Relay
I am new to Electronics and I am currently trying to wire up a SPDT Relay. I must admit I am totally confused. I want to have a SPDT switch that simply switches the relay over. Any pointers would be appreciated. When I currently energize the relay, I hear it cycling, which I would image that is not good. I simple want it to "switch" normally on and then when I energize the coil, switch is back.
Here is a copy of the Datasheet:
datasheet from radioshack
Edit - Solution
AI: I added #'s to the pins in the diagram to help describe wiring.
Using pins 3 & 4 - when a current flows between those pins it creates a magnetic field that then moves the internal contact.
When the relay is unenergized pin #1 is connected to pin #5, this is called Normally Closed (NC).
When the relay is energized (power applied) Pin#2 is connected to pin #5. In the unenergized state pin #2 and Pin #5 are not connected -i.e. they are Normally Open (NO).
This has a DC coil and the various specifications show you that when you supply at least 3.5 V at 89.3 mA then the contact closes (Pickup).
The contact will stay engaged until the voltage drops back to the 0.25V level at which time it disengages.
This difference in pickup and drop out is called hysteresis and helps prevent relay chatter if the input signal swings too much.
To wire this into a circuit, (it is rated for 1A at 120V AC) you would break the line wire, and connect the relay pins #2 and #5 inline. Neutral wire will remain connected. in #5 should go to the load, Pin#2 to the source (for safety reasons).
You will need to supply a 5 V source to Pins #3 & #4 that is capable of at least 100 mA.
simulate this circuit – Schematic created using CircuitLab |
H: What kind of inductive load does a mains LED lamp present?
This follows on from another question I'd been asking. Having been 'gifted' dozens of mains LED lamps, I've been blithely assuming that they don't offer much in the way of inductive load.
But, of course, they aren't just a mass of LEDs: there's a rectifier, and perhaps an inverter (though a glance at the wiring of the LEDs in my lamps suggests that there's two parallel chains of 65 LEDs, which would be about right to drop 230 V).
I've searched for information, but there's nothing that I've found. Does anyone know a) if there is appreciable inductance in such lamps, and b) how one could set up a test rig to measure it? thanks
AI: LEDs are a nonlinear load and probably these lamps will not have a power factor correction converter. This means that the current will not be sinusoidal therefore you will have some reactive power flowing. There may be a PFC choke before the rectifier bridge.
If you want to measure the power factor and harmonic content just take a scope with voltage and current probes and measure line voltage and line current.
PS. This it how you distinguish China Export mark from European CE: |
H: Pad size for JEDEC 1.0mm pitch 27x27 device
I have a JEDEC 1.0mm pitch 27x27 device. The only missing information I need to build a footprint for it is the size of the pads.
What size of pads should I use for a JEDEC 1.0mm pitch 27x27 device?
AI: Xilinx application note XAPP426 "Implementing Xilinx Flip-Chip BGA Packages" is probably your best place to look for an answer. |
H: PWM Motor speed control using PIC; What mosfet to use
I have a 5V PIC16f877a controlling the speed of the motor 12V which has a power rating of 8W; the current will be around(600mA) am I correct?
The motor is basically a small water pump commonly used in aquariums.
After much research; I still don't know what is the best MOSFET to use.
As I saw some of the answers use logic-level MOSFETs?
I have IRFZ46N and IRFZ22 in my hand; is the two transistor suitable and enough? or is there any other IR transistor is more suitable. i think IR will be much more available in my country.
Will the 12V 1000mA power supply I have enough?
AI: My usual part for this application would be the IRLML2502. It can easily handle the current, has nicely low Rdson with 5 V drive, and is good to 20 V.
Don't forget the reverse Schottky diode accross the motor or you'll blow out whatever trasistor you use after the first few times it tries to turn off the motor. |
H: How much Ampere is displayed on the multimeter?
here is a picture of a multimeter:
the display shows: 02,0
is it 2A or 2mA ?
AI: The range switch on the front of the multimeter shows the maximum current that can be measured on that range. The range switch is pointing at the "200m" DC Amps range in the picture. Therefore, the full-scale readout for this range will be about[1] 200 milliamps. If more than 200 mA of current passes through the multimeter on this range, the multimeter will display an over-range indicator instead of the measured current. This means that a display of "2.0" or "2,0" indicates a measured current of 2 milliamps, not 2 amps.
Also, notice that there are two sockets on your multimeter for measuring current. One is for use with the milliamp and microamp ranges, while the other socket is for use with the amp range. The milliamp range is fused (notice how only the 5A plug has the label "unfused"). Passing more than 200mA of current through the milliamp socket will blow the fuse to protect the multimeter. That is another way you can tell that you are measuring 2 mA and not 2 A.
[1] The exact full-scale range of many multimeters is not exactly the same as the number printed on the range switch. For example, on a Fluke 77 multimeter, the 300 mV range actually measures up to 303.1 mV before displaying an over-range indicator. |
H: Microprocessors/Microcontrollers - Do registers have addresses?
My Embedded Systems professor keeps referring to the memory locations of registers as their respective "addresses". I'm confused by this; I was always under the impression that in any microprocessor, the CPU registers don't have addresses since they don't reside in the main memory (they reside in the microprocessor itself). I am also confused about what we refer to when we say the "memory location of the register" - again, it's not in main memory.
With that said, why are we referring to the locations of the CPU registers by "addresses"? Do all/some registers have addresses?
I thought about this and reasoned that maybe they're "connected" to certain main memory locations, allowing access to the values stored in the registers. To extend this thought, is this what memory mapping is?
I should also add that we are working specifically with NXP's LPC1768 microcontroller, which uses the ARM Cortex-M3 microprocessor.
AI: It depends on the particular processor whether "registers" are in the same address space as regular data memory or separate. In either case, if there are multiple of them each one still needs a address.
Let's say the processor has 16 registers that are tightly coupled to the CPU and implemented separately from data memory. Those registers still have to be identified somehow. In this case, a 4 bit address would be needed to distinguish individual registers. In a RISC architecture, the 4-bit address of whatever register(s) a instruction worked on would be included in the instruction code. For example, the ADD instruction might add the value of a source register into a destination register. That instruction would include 4 bits to identify the source register and another 4 bits to identify the destination register. The documentation may refer to these registers by "number" 0 to 15, but that's really the address of where the registers lives in a special small memory by the CPU.
In addition to the above, even when a processor has special dedicated registers, those registers might be mapped into the general purpose data address space. References to those addresses are trapped and referred to the internal registers.
There are lots of schemes out there, but if you have more than one register, those registers need to be distinguished from each other somehow, and inside the hardware that will be with a "address", whether it is called that in the documentation or not. |
H: How do we OR two bits in ATxmega128?
I am working with ATxMega128 and programming it in C.
I have two inputs coming from a sensor and I want to turn on an LED when I get output from either of the sensor.
I can blink my LED if i get output from both of my sensor (i.e. I can do ANDING using &) but I do not know how to do ORRING. (Just need the syntax)
One way i can think of is to write two separate if statements taking one sensor at a time but I want to write a single if loop.
Can you please help me out?
Thanks.
AI: For OR you use the pipe symbol:
|
This is a vertical bar, usually the symbol is close to the enter key on the keyboard;
For example: int x = BIT0 | BIT 1;
However, seeing as you're asking rather basic questions, I recommend that you find a tutorial or book to cover this. K&R which is the C book covers this. I myself have written a tutorial (aimed at MSP430 but covering many general aspects) here. |
H: Why are typically fatal currents non-lethal when they pass through your body for a short time?
I've been reading up on electrical safety, and the commonly cited controversial quote "it's not the volts that kills you, it's the amps". What I have gotten out of these sources is that it is in fact the amperes that stop one's heart, but the voltage determines this current, and the body is a non-ohmic resistor. (I have read this which mentions a lot about the volts and amps).
However, I am confused as to how much time a current must be passed through your body in order to be fatal. This video states that if you were to model the human body as a 100 picofarad capacitor with a 1500 ohm resistor in series, a high voltage static shock would pass a very high current through the body, but for an extremely short time (less than a microsecond). How long would a potentially dangerous (>5mA) AC/DC current have to be passed through the body in order to harmful? I understand that this is maybe too general a question, but is it possible to give a figure accurate to a few orders of magnitude?
Also, if it is in fact the amperes delivered over time that are detrimental, would a unit such as the Coulomb be more suitable for determining how fatal an electric shock might be?
EDIT: I am assuming that the electric shock is delivered hand to hand where it is most likely to pass through the heart and thus heart fibrillation is of most concern. If there are other significant causes of death from hand to hand shocks that I have overlooked, please tell me.
AI: You need to bear in mind that there are many different modes of damage possible,
Large current passed though tissue may burn the tissue
Modest current passed through a vital muscle (like that of the heart) may cause that muscle to operate in a manner that it's not used to and strain it so that it is damaged from the strain.
Very tiny current may interfere with the normal nerve signals that drive the heart's operation, throwing off the heart rhythm leading to ineffective pumping for long enough to be fatal.
So it's not a matter of stating a particular voltage, current, charge, energy or power. It's a matter of stating a range of very particular and quite different circumstances that pertain to different body systems. |
H: Would it harm a LiPo to charge it in several periods?
I have a 3.7V 5000mAh Lithium-Polymer battery cell, which I'm charging with the MCP73831, using the typical application circuit on page 1:
I have \$R_{prog}=2\text{K}\$ and \$V_{in}=6.0\text{V}\$. Normally, I'd charge the cell during the evening and night, since it takes 10+ hours.
However, I'm testing this circuit, so I want to be near to check if everything's fine and to do what's needed when something goes wrong. Problem: I don't have 10 consecutive hours.
So would it harm the cell to load it in several short periods? Does it depend on the length of the periods or the time in between?
AI: Charging the cell over shorter periods of time with a delay in between won't do any harm, in fact it may cause less heat and generally be better unless the period between each charge is so long that self-discharge comes into play, but that doesn't sound like it will be the case here.
However for testing the charger it also means you might not discover a thermal problem that only occurs after it has been running the full time. After the initial test if the end-of charge cut-off looks OK you might want to error on the side of caution and test in an environment with nothing flammable around (outside over concrete for example) so you can check temperatures towards the end of the charge cycle without having to be around to keep your eye on it during the earlier phase. |
H: Question related self powered USB Hub
We have a requirement, which is a normal self powered USB Hub, with individual power control of the ports, i.e in addition to a normal Hub, we want to remove the power to any of the downstream port on the fly using on-board micro controller.
I am not an expert of USB2.0 specification, so, if any thing wrong please correct me. i am learning.
USB hub circuit has basically a USB Hub controller like TUSB8040, Quad Powerdistribution switch
I have thought 3 possiblities.
1. I thouht to connect all OE# pins from Power distribution switch to On-board MC(Micron controlller) and connect I/O's of MC to TUSB8040's OC# pins. SO, that whenever we want to disable the Power to a perticular downstream port, that port OE# pin we will indicate Over Curretn condition from MC to TUSB8040. SO, that TUSB will disable that Port according to USB Spec. But, when i contacted manufacterur regarding he said this involves host communication also and it is not possible.
2. in USB Spec on these following sections
in section 11.5.1.2 states of Downstream ports "
11.5.1.2 Powered-off
This state is supported for all hubs.
A port transitions to this state in any of the following situations:
• From any state except Not Configured when the hub receives a ClearPortFeature(PORT_POWER) request for this port"
One more section in USB2.0 spec, 11.11 Hub Port power control "A hub indicates whether or not it supports power switching by the setting of the Logical Power Switching Mode field in wHubCharacteristics. If a hub supports per-port power switching, then the power to a port is turned on when a SetPortFeature(PORT_POWER) request is received for the port. Port power is turned off when the port is in the Powered-off or Not Configured states."
Which indicates power to a particular port can be turned ON from Host if Hub supports the Per Port Power control.
for this i didn't get any reply from the Manufacturer yet.
3. we are planning to control the USB distribution switch using 2:1 mux ( one of the input from on board MC and another from TUSB8040, so, that when MC want to disable any port it can control ) When on board MC disconnects the Power to any Port it can be detected by Hub and reported to Host automatically.
I feeel 3rd approach is very good and works. Any body foresee any hiccups in this 3rd point method.
AI: If you are willing to sacrifice one of the hub ports, FTDI has devices that talk UART over USB and have a bunch of IO-lines on them that support bit banging, ready to use. Advantage is that is only a single chip and most operating systems have drivers available.
I believe it is this one: http://www.ftdichip.com/Products/ICs/FT232H.htm
That way you can use one of the hub's USB ports to connect to the chip that can be programmed to control the outputs.
From the datasheet:
Bit Bang Mode.
The 2 nd generation device has a new option referred to as “Bit Bang”
mode. In Bit Bang mode, the eight UART interface control lines can be
switched between UART interface mode and an 8
- bit Parallel IO port.
Would be a nice fit with your option #2 |
H: Controlling MSP430 PWM with a Laptop
I have written a code which takes two digit number from laptop and changes the PWM dutycycle to that number. It is part of a bigger requirement where I need to control motor speed over UART.
#include "io430g2553.h"
#include <stdint.h>
void PWM(uint8_t duty_cycle);
void PWM_Config();
int main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
WDTCTL = WDTPW + WDTHOLD;
BCSCTL1 = CALBC1_1MHZ; // Run at 1 MHz
DCOCTL = CALDCO_1MHZ; // Run at 1 MHz
PWM_Config();
PWM(5);
__delay_cycles(5000000);
PWM(15);
__delay_cycles(5000000);
PWM(25);
__delay_cycles(5000000);
PWM(50);
__delay_cycles(5000000);
PWM(25);
__delay_cycles(5000000);
PWM(15);
__delay_cycles(5000000);
PWM(5);
while(1)
{}
}
void PWM_Config()
{
P1OUT &= 0x00; // Clearing P1OUT
P1SEL |= BIT6 ;
P1SEL2 &= ~BIT6 ;
P1DIR |= BIT6; // Configuring P1.6 as Output
}
void PWM(uint8_t duty_cycle)
{
TA0CTL =0;
TA0CTL |= TACLR;
TA0CCR1 |= (duty_cycle*100);
TA0CCR0 |= 10000;
TA0CTL |= TASSEL_2 + MC_1 + ID_0;// Register TA0CTL -> SMCLK/8, Up mode
TA0CCTL1 |= OUTMOD_7 ;//Set/Reset Mode
TA0CCTL0 &= ~CCIE; // Interrupt Disabled
}
Edited My question on received comment:
The problem with the void PWM(uint8_t duty_cycle) function is that first time it generates the correct PWM at P1.6, next if it is given a value it changes PWM to that DC, but I can not go back to lower DC.
the fisrt 2 PWM functions in the code changes to correct duty cycle PWM(5),PWM(15) then the rest of PWM values do not produce desired dutycycle.
I am not able to troubleshoot where am I wrong, can any1 help?
AI: Change the:
TA0CCR1 |= (duty_cycle*100);
To a simple assignment:
TA0CCR1 = (duty_cycle*100);
Otherwise you are OR'ing the previous value with the new one, eventually filling it with ones. That is why you can't go back to a lower duty cycle.
By the way, I don't know if your MSP430 has a hardware multiplier, but if it doesn't you should avoid direct multiplications whenever possible because they may take quite a few cycles to execute. Use instead powers of 2 (like 128), because you only need to left-shift the value. |
H: Powering an IC from a GPIO line
I've got a low power application which will be powered from a Li coin cell. I've achieved satisfactory sleeping current with my chosen MCU.
The application ADC IC however is a different matter: 900µA while inactive -- way too much for a coin cell application.
So I thought why not isolate the power to the ADC when it's not in use. Two ideas came to mind: a high-side FET on the ADC's Vdd or just connecting the ADC's Vdd (or Vss) pin to one of the MCU GPIO pins (assuming current is within the MCU's source/sink spec).
I assumed there would be plenty of articles, app notes etc discussing this idea, but I've yet to find anything on line. Before I start experimenting, can anyone point me to any relevant articles/app notes online? Or is it just a bad idea? and if so why?
(Ya, know most MCUs have ADCs built in. For reasons beyond the scope of the query, I really must use this external ADC IC.)
Thanks!
AI: Powering a device through a GPIO pin is usually a bad idea. In the very low power regime, perhaps you could get away with it, but I would not recommend it unless you have very severe constraints.
You've already noted that you've checked that the ADC's requirement is lower than the pin's drive capability. That is typically what lot of people don't bother checking. If the consumption is within the required limits, then you may be fine on that count. However, make sure that any transient current requirements from the ADC are also contained within the GPIO drive capability. You would at the very least require reasonably heavy decoupling on the ADC supply. Remember the fact that the GPIO output isn't a low impedance supply line, and will be slower to respond to transient current requirements.
Secondly, since you're using an ADC, and at that an ADC that isn't built into a uC (which would be what you should be doing for very low power consumption), I'm presuming you have some requirements which aren't satisfied by the internal ADC. The GPIO, not being a supply line, and more importantly, being a GPIO of a microcontroller, will most definitely be contaminated by atleast the clock frequency of the uC, its harmonics, and possibly subharmonics. Since you're also going to be driving some substantial current through it, I would not be surprised if other effects are brought in as well. You may even end up seeing small components of your SPI/I2C/what have you in the supply, depending on which GPIO you use and how heavy the decoupling is. If ADC resolution and noise performance is important, then perhaps this is not such a good idea even if the GPIOs seem to be capable of driving the IC.
The high side FET is a much better bet, and is safer. You could also consider using any number of power related ICs which have Enable control, such as LDOs and the like. An LDO close to the ADC supply may also help with improving performance. Note, though, that this means your ADC will have to run at a slightly lower voltage. This will happen with a simple transistor switch as well, and with a low Rdson FET the effect will, admittedly, be much smaller, but it will exist.
One thing that you should note is that connecting an unpowered IC's digital lines to GPIOs of a powered uC is not a good idea. You will end up powering up your ADC through its digital IOs and cause strange, and potentially dangerous behaviour. Specifically, I would be surprised if your ADC did not respond even when OFF. This is capable of causing long term degradation, and eats into the advantage of power saving in the first place. In order to make it turn off well, you should use a level translating buffer for every digital line between the two with the ability to disable (tristate) the outputs. This can be done either using an EN pin, perhaps, or using a buffer with other mechanisms to disable (The SN74LVC1T45 tristates if the supply on one side is pulled to ground, for instance). Whether the scheme is useful depends on the consumption of the buffer in it's OFF state, the consumption in it's ON state, and the duty cycle (the fraction of time you want to turn it ON for), and the ADC consumption (900uA) that you can save by doing this. If you are very careful, you may be able to avoid the need for the buffers by tristating the uC IOs that are connected to the ADC before shutting it off, and thereby producing about the same effect. |
H: How does Fourier series apply to signals?
I have the complex form of Fourier serie:
It says that an and bn are real numbers, while c is a complex number. I need Fourier serie to represent an electrical signal that should transmit bits. In this case, what do an and bn represent? How do I calculate them?
AI: Fourier series can only be used to represent repetitive signals. So if you want to use Fourier series to represent a "signal that should transmit bits", it will have to be a signal that transmits the same bits over and over.
what do an and bn represent?
They represent the relative magnitude of the in-phase and quadrature components of the harmonics in your signal.
Which doesn't really tell you anything new.
What you've really done by taking the Fourier series is found a new way to represent all the information in your signal. Mathematically, you've transformed it to a new basis set.
This is useful because, for example, if you were to pass the signal through a filter with a known frequency response, it would be much easier to calculate the output by using the new frequency domain basis set, than directly using the time-domain representation.
How do I calculate them?
Your 2nd, 3rd, and 4th equations are exactly how you calculate them.
Two key points. First, c is not a complex number, it is a real, as shown by the 4th equation.
Second, your first equation should be more like
\$g(t) = \dfrac{1}{2}c + \Sigma_{n=1}^{\infty}a_n{}\sin(2\pi{}nf_0t) + ...\$
Note the added n in the argument of the sine, as mentioned in the comments.
Also, notice I use f0 instead of just f. Here f0 is the frequency at which your signal repeats. That is, f0 is \$\dfrac{1}{NT_b}\$, where N is the number of bits in your repeating sequence, and Tb is the period of a single bit. |
H: Saturating a N-Channel MOSFET
I have created a schematic for a circuit that I wish to create. I believe the underlying circuit is pretty solid; however, I am having trouble picking parts with the right specs. I have attached the schematic of the circuit I wish to create. My question has to do with the transistor. How much voltage do I need to provide the following transistor to make it fully on. I know the data sheet says it needs 2 volts as its threshold; however, that only allows a small amount of curent to flow through the transistor. How do I know how much voltage I need to make it fully on. Also, how do I determine what type of resistor to use from the 5V GPIO pin to the gate of the transistor.
Here is my circuit:
simulate this circuit – Schematic created using CircuitLab
My other question is what do I need to look at to make sure the diode is strong enough to handle the EMF kickback. The diode I am looking at is from Jameco with model number 1000 VOLT 1 AMP SILICON RECTIFIER DIODE.
AI: The gate threshold voltage of a FET isn't all that useful in a design. What you care about is how on the FET becomes when your gate voltage is applied. This is the Rdson spec, which may be listed at multiple gate voltages.
You are using a 2N7000, which is not a particularly impressive FET. At 4.5 V gate voltage, it gets down to 5.3 Ω. That may be OK if the relay coil is significantly more than that, which it probably is. Let's say the relay coil is 80 Ω. In that case the total resistance will be 85.3 Ω, the current at 5 V will be 59 mA, the drop accross the FET 311 mV, leaving 4.7 V accross the relay. Not great, but should be good enough. However, note that this was a example. Do the math with whatever resistance your relay coil really has.
To drive a FET like this, there is no need for a resistor between the digital output and the FET gate. Just connect them directly. The flyback diode needs to be rated for whatever maximum current will go thru the relay coil. A little less will be OK since the diode will only be conducting the current for a short time. Unless you have a "large" relay (in which case the 2N7000 probably won't be good enough), the 1N4148 you show should be good enough to catch the kickback current.
A few problems with your circuit:
You need to rectify the 12 V out of the transformer before running it into the 7805 regulator. Four diodes in a full wave bridge configuration would do nicely. Use something like 1N4001, or a integrated full wave bridge module. Put a cap after the bridge to hold the DC level high enough for the regulator between the line cycles.
The peak voltage of a 12 V sine will be 17 V. Minus about 1.4 V drop for the full wave bridge, you are left with 15.6 V at the peaks. When unloaded, it could be a few volts more. This is well within the voltage spec of a 7805, but will cause it to dissipate a lot of power. If you can find a "6V" transformer, that would be a better choice.
The relay can most likely work from AC, but the FET can't switch AC. The top of the relay must also go to the output of the full wave bridge instead of the transformer directly. Keep in mind that the relay will then see the higher unregulated voltage, which could be 15-20 V with this transformer. That might be OK for a "12v" relay, but you might need to put a resistor in series with it to stay within the maximum allowed coil current spec. |
H: F-SW22 vs F-SW33 flux. What to these figures mean?
I was thinking of purchasing a no-clean flux pen from my supplier, but there are two options, F-SW22 and F-SW33. What do these codes mean and what types of job is each suitable for?
AI: F-SW-22 is weakly corrosive and contains inorganic salts.
F-SW-33 is non-corrosive and is rosin free w/o halides.
You'd use F-SW-22 if there was solder-ability issues, but you must clean the board after wards.
You'd use F-SW-33 for a normal (cleaner) situation, and is advertised as no-clean . I'd recommend you clean it anyways. |
H: Will a device capable of receiving a 200 Vrms input signal happily accept a 200 VDC signal?
To the best of my knowledge, Vrms is used to express an AC signal as the equivalent DC signal that would produce the same power dissipated in a resistor R; I believe this is best calculated using a thermistor to measure the heat given off from the resistor.
Now, if an analog input device were to specify that it can accept a 200 Vrms signal, wouldn't it follow that it can happily accept 200 VDC as well since Vpk-pk of the AC signal must be at least as large as 200V to achieve the 200 Vrms rating?
If the above statement is correct, then it follows that the opposite is not true; that is to say a device with an input spec of 200 VDC may not necessarily be happy with a 200 Vrms signal as that AC signal might have peak voltages over 200V which could damage the input circuitry.
Somebody please edify me
Edit
As requested, here is the device in question. It is a National Instruments 9255 C-Series module. Apparently, it actually supports up to 300Vrms but the same question applies. Also, here is the datasheet.
AI: The first part of your logic is often correct. However there are some instances where it is false. For example, supposing the input is a transformer, then it may be quite happy with 200 V AC input, but would burn out if you apply 200 V DC because its impedance at DC (ie: its resistance) is very low. This certainly applies to power transformers, for example those in power supplies (PSUs of the non-switching variety). While there are probably not many devices whose signal input stages are transformers, there certainly are some.
The second part of your logic (" the opposite is NOT true") is sometimes false, sometimes true (ie: your conclusion doesn't follow). Some devices happy with a 200VDC input may be happy with 200VAC input, some not. |
H: How do I know if my hall-effect sensor is working correctly?
On pg. 18 Figure 5 of this data sheet you will see a pulse train required to program the sensitivity of the A1362 Hall-Effect sensor.
I am using the following circuit:
Using Figure 5 from the data sheet, I simply power on the Hall-Effect sensor by supplying the 5V VCC. Switches SW8,9,and 10 start out being in open state. Here are my steps:
Close SW8 // high pulse
Open SW8
Close SW9 // mid pulse
Open SW9
Close SW8 // high pulse
Open SW8
Close SW9 // stream of mid pulses, each time incrementing sensitivity counter by 1
Open SW9
repeat steps 7,8 0 - 255 times as necessary to set the sensitivity of hall-effect sensor.
When I bring the north / south pole sides of a magnet close to the hall-effect sensor, the voltage readings I get at the VOUT pin are almost identical. But if the sensitivity of the hall-effect sensor has changed I should get different voltage readings. This means I am not setting the sensitivity correctly. What am I missing?
From previous posts, others have said to watch out for my current readings too. So here is some more information:
At VpH the multimeter reads ~ 200mA
At VpM the multimeter reads ~ 100mA
At VpL the multimeter reads ~ 3.5mA
AI: Using VpH as an example the current will be limited to around 90mA by the resistor R7. The datasheet says the minimum current guaranteed to blow a fuse is 300mA and even recommends a 0.1uF capacitor to ensure enough current is available.
A simple solution more likely to work would be to scrap the resistor divider and use something like an LM317 adjustable regulator and switch the voltage set resistor shown as R2 in the typical application circuit instead. Using 1% resistors should keep you well within the tolerances given in the datasheet.
Also take note of markrages answer, switch bounce is likely to be a problem so ideally apart from a more robust supply you should be switching voltages from a microcontroller. The LM317 datasheet shows Iadj is limited to less than 100uA so you could achieve that using any form of transistor or analog switch that doesn't introduce too much resistance. |
H: How electronic components keep synchronized?
So, voltage travels super fast right? Still, there has to be some lag between voltage traveling from one transistor into another. How is a circuit kept synchronized then?
AI: The need to ensure that signals arrive at the proper time is the core of what it means to design a digital circuit, including processors, memory etc. IF two signals need to be present for a system to then change it's operation and one of those signals arrives late, then the system does not work.
THere are several ways that this is accomplished. The dominant method (99 + %) is through the use of synchronous logic, also called clocked logic. There is a central time base called a clock that initiates activity and the system is carefully designed so that all the signals are in place and settled and ready for when the next "tick" of the clock arrives. This system is simulated by varying, the speeds of the transistors, the operational voltage and the temperature to ensure that under all conditions the signals will arrive before the next clock tick. These simulations take into account the actual placement of the devices on the die and how heavily loaded the signals are. A transistor that is further away will get a signal later, a more heavily loaded sinal will respond more slowly.
There are many circuit solutions to help the designer accomplish her "timing closure". |
H: Wear leveling on a microcontroller's EEPROM
For example: The datasheet for ATtiny2313 (as do most Atmel AVR datasheets) states:
128 Bytes In-System Programmable EEPROM Endurance: 100,000 Write/Erase
Cycles
Imagine a program only requires two bytes to store some configuration, the other 126 bytes are effectively wasted. What concerns me is that regular updates of the two configuration bytes may wear out the device's EEPROM and render it useless. The whole device would become unreliable, because at a certain moment you just can't keep track of which bytes in EEPROM are unreliable.
Is there a smart way to do wear leveling on a microcontroller's EEPROM when you effectively use only one or two bytes out of available 128?
AI: The technique I normally use is to prefix the data with a 4-byte rolling sequence number where the largest number represents the lastest / current value. In the case of storing 2 bytes of actual data that would give 6 bytes total and then I form into a circular queue arrangement so for 128 bytes of EEPROM it would contain 21 entries and increase endurance 21 times.
Then when booting the largest sequence number can be used to determine both the next sequence number to be used and the current tail of the queue. The following C pseudo-code demonstrates, this assumes that upon initial programming the EEPROM area has been erased to values of 0xFF so I ignore a sequence number of 0xFFFF:
struct
{
uint32_t sequence_no;
uint16_t my_data;
} QUEUE_ENTRY;
#define EEPROM_SIZE 128
#define QUEUE_ENTRIES (EEPROM_SIZE / sizeof(QUEUE_ENTRY))
uint32_t last_sequence_no;
uint8_t queue_tail;
uint16_t current_value;
// Called at startup
void load_queue()
{
int i;
last_sequence_no = 0;
queue_tail = 0;
current_value = 0;
for (i=0; i < QUEUE_ENTRIES; i++)
{
// Following assumes you've written a function where the parameters
// are address, pointer to data, bytes to read
read_EEPROM(i * sizeof(QUEUE_ENTRY), &QUEUE_ENTRY, sizeof(QUEUE_ENTRY));
if ((QUEUE_ENTRY.sequence_no > last_sequence_no) && (QUEUE_ENTRY.sequence_no != 0xFFFF))
{
queue_tail = i;
last_sequence_no = QUEUE_ENTRY.sequence_no;
current_value = QUEUE_ENTRY.my_data;
}
}
}
void write_value(uint16_t v)
{
queue_tail++;
if (queue_tail >= QUEUE_ENTRIES)
queue_tail = 0;
last_sequence_no++;
QUEUE_ENTRY.sequence_no = last_sequence_no;
QUEUE_ENTRY.my_data = v;
// Following assumes you've written a function where the parameters
// are address, pointer to data, bytes to write
write_EEPROM(queue_tail * sizeof(QUEUE_ENTRY), &QUEUE_ENTRY, sizeof(QUEUE_ENTRY));
current_value = v;
}
For a smaller EEPROM a 3-byte sequence would be more efficient, although would require a bit of bit slicing instead of using standard data types. |
H: Why is the base currect incorrect?
My multimeter shows:
Ib=218uA why?
But my calculation shows, it should be: 8.5uA
I used the formula:
Ib=(3.1-0.7)/(10k+271k) [I take Beta=270, BC548 transistor.]
What is the problem? Why is Ib = 218uA, instead of 8.5uA?
AI: The base resistor multiplication effect that you used in your calculation happens because the base emitter (R4 in your circuit) increases voltage both due to the base current and due to the collector current. So in order for the this effect to be what you expect, the transistor has to be in forward active mode. But here, the transistor is in saturation.
Consider if the transistor were forward-active and the base current were 8 uA. Then the collector current would be 2.3 mA. Then if there were 2.3 mA through R5, the collector voltage would have to be -227 V. Since the transistor isn't a power source, this can't happen, and we know the transistor is saturated. |
H: Do any SMT components require hand soldering due to heat limitations?
It has been claimed on another board that some SMT components cannot be used in an automated production line (i.e. reflow or wave soldering) because they cannot withstand the heat/temperature. Hand soldering is used to avoid these problems.
An example given where this was the case was film capacitors. Capacitors are often the component which limits the maximum temperature and time at high temperature, but I haven't seen any that preclude the use of reflow soldering.
I haven't encountered a single SMT component that cannot be used in an automated soldering process in the past. Some require care i.e. the temperature profile must be carefully chosen and times at high temperature limited. Some components do not support the use of lead free solder (in terms of maximum temperature), but these are becoming rare.
I suspect that requiring hand soldering is either due to:
Limitations in the equipment i.e. the reflow oven cannot deliver heat
quickly enough to meet the requirements.
Poor design i.e. it hasn't
been designed with reflow in mind and large and small components
cannot be soldered at the same time.
A few very special components
require special treatment and it is easier to hand solder than change
manufacturing processes.
Small scale production where hand soldering doesn't cause costs to explode.
I also feel it might be incorrect to assume that hand soldering results in lower temperatures, but that is not the core question here.
I don't think it would ever be an inherent limit in an SMT component - they pretty much came about to support automated manufacture.
Thoughts?
AI: I have never encountered a SMD part that needed to be hand soldered.
Probably what someone ran into is a part that needed a special profile such that the board would have had to be run thru the oven twice. If this is due to a single part, it could well have been more cost effective to run the board thru the normal process and hand solder the special part afterwards. It's not that it couldn't be reflow soldered, but that for that process in that situation it wasn't economical. I have seen this case a few times.
Another case I've seen a few times is when there are only a small number of parts on the bottom of the board. Two-sided reflow takes some special handling, and for a very small number of parts it's more cost effective to run the normal process for the top side, then add on the small number of bottom parts by hand.
More stuff is hand soldered than you might imagine in places where the labor rate is low. A factory one of my customers used in China had a whole manual assembly line right next to the more automated pick and place and reflow line.
Again, it is highly unlikely what you heard is due to a part needing to be hand soldered due just to the part itself. A assembler may have said they "need" to hand solder a particular part, but that was due to their process and tradeoffs, not inherent to the part. |
H: Why does active low even exist?
In my career I've often encountered signals that are active low (Reset being the most common). I've even seen interfaces where all control signals are actively low.
To me, this is very unintuitive and confusing.
Why is there ever a need to use actively low?
Is it merely historic or is there actual gate count / power concerns that explains it?
AI: In historical digital designs, active low signals would be used whenever their use would allow reducing the number of gates in a design, and thus reduce the cost of the circuit. I can imagine it was even more common in IC designs than in discrete logic, because all logic was essentially built from inverting (NAND) gates, but I'm not personally experienced in that area.
That level of optimization is rarely needed today, or at least it's done automatically by synthesis tools so that it's transparent to the designer. Like you noticed, there's only a few cases where active low signals are still very commonly seen.
One advantage of an active low signal for functions like reset and interrupts, is it's very easy to create "wired OR" logic for an active low signal simply by using open collector outputs.
That is, if there's several different circuits that need to be able cause a reset or an interrupt, each of them can simply have an open-collector output tied to the ~RESET or ~INT wire. Then, any one of them can pull the line low and cause the appropriate response without the need for any additional logic to combine the signals. |
H: Can I use Formula SP-30 self-cleaning acid paste flux?
I am a complete noob when it comes to soldering. I've only done a little bit in the past and it was years ago. Today, I bit the bullet after reading about how to solder and purchased some soldering supplies a the local Frys. When I got home I read the label for the paste flux I purchased and it said:
Kester
Self-cleaning Acid Paste Flux
Formula SP-30
I didn't see anything that said rosin, so I went online and read the manufacturers datasheet. It says:
Like other inorganic acid fluxes, Kester SP-30 is too corrosive for
electrical or electronics soldering applications. In all cases, the
flux residue should be removed after soldering to avoid any corrosion
problem.
Did I just buy plumber's flux instead of electronics flux? Does this product have any utility in electronics? If not, why would Frys put something like this in the electronics soldering isle?
AI: Yes, if it's an acid flux, you can't use it with electronics like they say. Definitely sounds like plumber's flux. I would return it to Frys. |
H: Zero crossing detector: do I really need the 7W resistor?
I am trying to provide zero crossing detection to my controller. Using the schematic below, I managed to generate square wave signal, representing positive v/s negative half-period. The problem is that the resistor needs to be quite large :
CTR > 10%
Max diode current: 60ma.
I choose 30 ma working diode current. This yields 30ma * 230V = 6,9W for R1.
Quite the heater. Also, voltage rating above 400V is required. I realize that a transformer could be used to step down the mains voltage. However, those guys tend to be bulky and rather expensive. Any recomendations?
Edit:
I found some nice explanations onHardware deign and noise suppression on the site. stevenvh's answer looks especially promising on calculating the resistor value. So let's keep my question more general. What are the approaches - resistor, transformer, others. What characteristics are desired in the optocoupler? Is the chosen driving current (30mA) huge and unnecessary?
AI: Consider replacing the optocoupler chosen, with one that is designed for direct interface to a mains power line. For example, Fairchild Semiconductors MID400 is one such part.
Use a much lower LED current. While your opto may specify a fairly large (20mA to 100 mA, even 1 A in some cases) drive current for the LED, many will work fine at as little as 1 to 2 mA: The part's transfer curve should provide enough information to confirm this.
A capacitor can be used as an impedance element for dropping the input AC voltage, instead of the resistor. As the voltage drop is almost entirely pure reactive, there is hardly any thermal dissipation to be concerned about. You do however require "X" rating capacitors, designed for use in AC mains circuits. |
H: What is "Saturated CTR" of an optocoupler?
For example, in the datasheet of 4n27: .
So what is saturated and what is non-saturated CTR?
AI: Page 134 of your datasheet: "DC Current Transfer Ratio" and "N" for "Normalized".
This is the ratio between collector current and LED current. If you vary the current through the LED, the current through the transistor will vary too:
\$\boldsymbol{NCTR} = \frac{I_C}{I_{LED}}\$
According to figure 2 - 5, measured under the following conditions:
\$\boldsymbol{V_{CE}=10 \text{V}}, I_F= 10 \text{mA}\$ and at various
ambient temperatures (\$T_A\$)
and
\$\boldsymbol{NCTR_{SAT}} = \frac{I_C}{I_{LED}}\$
According to figure 2 - 5, measured under the following conditions:
\$\boldsymbol{V_{CE}=0.4 \text{V}}, I_F= 10 \text{mA}\$ and at various
ambient temperatures (\$T_A\$)
In the latter case the transistor is in saturation, this means the collector-emitter voltage across it is so low that the transistor is unable to further increase the current by changing its conductivity (due to more light from the LED). |
H: Motors controlling Arduino usb question
simulate this circuit – Schematic created using CircuitLab
I made a RC car with an Arduino board, using an H-bridge to operate the motors. I connect them through a capacitor and a diode to the +5 V pin of the Arduino board to avoid damages on the board. I wrote a simple program. I am using an ultrasonic sensor to avoid objects. The idea is when I don't have an object in front of me, then a command to move forward must be turned on. When there is an object, the motors must go in reverse, move for a while, then go forward and turn right. I use 2 DC motors, one for reverse and forward drive, and one for right and left (steering).
The problem is this: if I connect the board to the computer through the USB cable, and at the same time I turn on the car then the code is executed normally, but if I remove the USB cable and I turn on the car (using the ~ 5.4 V from BAT1 through D1) then the car doesn't move forward, it goes back, stays, goes forward, and turns right - this is repeated twice and after that the program starts to function normally.
Here is the code :
int forward = 11;
int reverse = 10;
int left = 9;
int right = 8;
#define ECHOPIN 3
#define TRIGPIN 2
void setup() {
Serial.begin(9600);
pinMode(forward, OUTPUT);
pinMode(reverse, OUTPUT);
pinMode(left, OUTPUT);
pinMode(right, OUTPUT);
pinMode(ECHOPIN, INPUT);
pinMode(TRIGPIN, OUTPUT);
}
void loop() {
digitalWrite(TRIGPIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIGPIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIGPIN, LOW);
// Compute distance
float distance = pulseIn(ECHOPIN, HIGH);
distance= distance/58;
Serial.println(distance);
delay(200);
if ( distance < 12.50) {
analogWrite(forward,0);
delay(1000);
analogWrite(reverse,100);
delay(1000);
analogWrite(reverse,0);
delay(1000);
analogWrite(forward,100);
digitalWrite(right,HIGH);
delay(1500);
digitalWrite(right,LOW);
delay(500);
}
if ( distance > 12.50) {
analogWrite(forward,100);
delay(1000);
}
}
AI: From the very sketchy description of the problem as provided, one can only speculate that possibly the Arduino board or the motor drivers are not receiving sufficient power in the battery powered mode, to function normally.
The older 5 Volt Arduino boards are designed to operate with either a 5 Volt regulated supply on +5V pin, 5 Volts through the USB, or a DC voltage of between 7 and 12 Volts (or thereabouts) from an external supply. While most Arduinos will operate down to 6 Volts on the external supply, ~5.4 Volts leaves too little headroom for the on-board Low Drop Out regulator to output a stable 5 Volt.
Also, on turning on any of the motors, it is almost definite that the supply voltage will drop even further at least briefly, thus causing unpredictable behavior from the Arduino, including possible board resets.
If you must use the 5.4 Volt battery, better results may be obtained by using a buck-boost regulator (DC-DC step-up+step-down regulator, not a linear regulator) that is capable of producing a regulated 5 Volts from an input voltage all the way down to 4 Volts or so, and up to 6 or more Volts. That way, the Arduino is assured of a stable 5 Volt supply despite battery supply variations over a wide range.
For a more problem-specific resolution, it helps to provide a schematic and more detailed information, including perhaps relevant code. |
H: How to analyse Darlington pair?
Is the LEFT circuit of darlington pair, equivallent to the RIGHT transistor circuit?
Is my asumption true?
I replaced the two transistors in darlington pair with one; having beta equal to the product of betas of the two transistors, and the voltage from of 1.4 (0.7+0.7) across Base and Emitter.
Then I am calculating the Ib and hence the Ic.
In practical experiments, I found that my calculations are not very exact, but close enough.
For example, for the circuit to the right I found:
Ib = 63 nano Ampere
Ie = 4.5 mA
In measurements, I am finding the Ie about 5.5 mA.
AI: An important Darlington property that is not accounted for in your right circuit is the increased collector-emitter saturation voltage \$U_{CE,SAT}\$.
Allow me two random examples of fairly general purpose transistors where Ic=100mA:
BC547 (regular): \$U_{CE,SAT,max}=600mV\$
BC517 (Darlington): \$U_{CE,SAT,max}=1000mV\$
Notice that these values are maxima, the typical value for the Darlington isn't mentioned, but in practice the difference between thesaturation voltages will be much larger.
This is caused by the fact that the Q1 (output stage) can never reach full saturation. If \$U_{C,B1} = 0\text{V}\$ (ideally), there will always be the \$U_{B1,E} = 0.7\text{V}\$ voltage drop in Q1.
simulate this circuit – Schematic created using CircuitLab
As a result, a Darlington transistor will dissipate more power than a regular one at a given collector current. |
H: Do I need any specific hardware and/or software to use Mechatrolink for communication?
I googled it and know that it is a communication protocol.
My question is that whether I need any specific hardware and/or software to use Mechatrolink for communication?
Also if possible, please tell me the advantage to use Mechatrolink. Thanks
AI: Physical layer support is defined here on their site. If you take a look:
You are either going to support RS-485 or Ethernet. Once you are above that step you probably can be lazy and implement the rest in software. I would need a full specification to read to tell you for sure. |
H: How paint an electronic circuit?
I want to make a electronic circuit more hidden. So, I want to make it all black. The easy way is get a spray ink and use it. But will it work? Which ink or paint I can use?
AI: If you want to make a small circuit less obvious, one way is through potting. The potting material is inert, it adds tamper-resistance and should be acceptably black for your needs. |
H: Simplifying a circuit to measure current
So I'm to calculate the current in the places I put the ammeters in (yeah, I reckon one of them is turned around :)):
And while I can calculate such things for series or parallel circuits, I was taught I should first try to simplify the circuit and do it with Ohm's law and supplementary resistance. So I did something like that (which is my only idea):
And, regretfully, the results in the simulator are different. Then, how can I evaluate the 3 Ohm resistor (the one being "vertical" in the first picture) to somehow simplify the circuit and be able to calculate it? Could you please help? :)
AI: Since this is homework, I'm not just going to give you the answer, but I will show you a method for attacking this problem. I'll use the same designators rawbrawb did. Whenever you show a schematic, add designators to make it easy to talk about. We don't want to be saying "the second from top resistor next to the switch" or something.
Immediately you should be able to see that this circuit has two parts, the mess of stuff formed by R1-R5, and R6. These two parts are in series. R6 is already as simple as it gets. You should be able to see that R1-R5 is equivalent to a single resistor from the rest of the circuit's point of view. Once you have the equivalent formed by the R1-R5 mess, you have two resistances in series and the solution should be trivial.
The problem now gets down to solving the equivalent resistance of the R1-R5 circuit. This you can break down into pieces. Pretend a 1 V source is applied to this circuit. If we can find the current drawn from that 1 V source, we can find the equivalent resistance by Ohm's law.
Start out by taking away R3. Now you just have two voltage dividers, R1-R4 and R2-R5. Each of these can be simplified into a Thevenin source. From inspection, you can see that the R1-R4 source is 1/2 V and 2 Ω. You can also see that the R2-R5 source is 2/3 V, and 2 seconds with a calculator tells you the resistance is 1.5 Ω. Now you can put R3 back between the two Thevenin sources:
At this point you should be able to solve for the voltages at each side of R3 easily. Once you have those, you go back to the R1-R5 circuit with 1 V applied and figure out the total current. From the total current, you can find the equivalent resistance. with the equivalent resistance of R1-R5, you go back to the original circuit and solve the total current. |
H: Any reason not to use Timer0 on AVR?
Just a basic question... For arduino/avr/ATMega328 I find lots of examples using Timer1 (there's even a whole library for it) but rarely any that utilize Timer0 (or Timer2).
Now, I know that using any of these timers to control an ISR method will disable the use of PWM on it's associated pins, but is there a specific reason that people seem to stay away from Timer0? Is it used for something else internally that one should not mess with?
My current application is fine using Timer1, I'm just curious if I'm missing something about these other often neglected timers.
AI: If the question is about a bare AVR microcontroller, then no, there is no constraint on using any of the timers.
For the Arduino, Timer0 is best avoided, as the millis(), delay() and all internal timekeeping in the Arduino libraries use this timer. Changing it's time constant will impact these operations.
Timer1, as the question states, is the popular first choice for any timer / counter tasks, through libraries such as the TimerOne library, as well as direct manipulation. It is a 16-bit timer, thus with finer resolution than the 8-bit timers.
Timer2 is used by the tone() library, but since that is not so ubiquitously used, there is also the msTimer2 library that many find very useful, much like TimerOne. Direct manipulation of Timer2 is fine too.
The additional timers on the Mega, Timer3, Timer4 and Timer5, each a 16-bit timer, are also available for use, if you use an Arduino Mega board. |
H: Wireless communication with robot
I am making a simple robot, and am using a relatively cheap RF transmitter and receiver to send commands to my robot. Essentially, the transmitter end would send data from an AVR MCU via its UART to the RF transmitter, and a similar setup on the robot would pick up the data.
So what I am confused about is how this whole process works. I mean, suppose I have four motors on my robot which all need to be controlled individually and at the same time. How would I accomplish this? Would I encode my info in a byte (say, 1111000) where the first four bits represent the on or off position of the four motors, and the receiver would decode this and carry out the necessary task? Or is there another, better way of doing this?
This leads to my next question related to this. Suppose the method I just described is used, then how is the robot typically programmed to handle commands? Say, it receives the 11110000 packet, and turns on all four motors. Do I just let the robot keep the motors on until a new packet of info is received? Essentially, if I want continuous communication with my robot (one way is fine in this case), how would I do it if it takes a certain amount of time between each signal which is sent to be processed and carried out before the next one comes in? Maybe the time it takes for the signal to be sent, processed, and carried out is is small that the impact is unnoticeable?
EDIT: Here is a link to the RF Tx/Rx I bought.
AI: One challenge using those types of RF modules is that the receivers can receive a lot of random noise between transmissions. They also like the signal transmitted to be DC balanced, long strings of zeroes and ones can cause distortion in the output from the data slicer in the receiver.
The usual way to deal with random noise between transmissions is to introduce a preamble to that the receiver knows a valid packet is on the way and to synchronize the UART ready. Maintaining the DC balance requires using an encoding scheme that keeps the number of 1 and 0 bits in each byte as close as possible to equal.
I've used the following application note from Radiotronix that includes a source code example in the past to implement a system that worked well using modules similar to the ones you're using. The only change I had to make was to introduce a delay before transmitting and increase the length of the preamble, although that was mainly required because I was powering down the transmitter between transmissions so you may not require the same.
Radiotronix Application Note AN-401
Once you have the basics sorted you'll need to consider what to do when a transmission is lost, I'd recommend sending the data several times and then have a timeout that will stop the robot after a pre-determined time. You may want to also consider using some relatively long (say 4 byte) commands that are essentially random (ie. don't use 1,2,3) so that you can determine the difference between a valid command and a data error.
I'd probably start with a baud rate of 2400bps for those modules. Using the above scheme that will give a transmission time of somewhere around 40mS so if you were to transmit each command twice a latency under 100mS should be realistic. |
H: LTI Response Help
A system is known to be LTI. The response of the system to a step function u[n] is δ[n] + δ[n-1].
a.) Find the response of the system to 2u[n] + u[n-1]
b.) Find the response to the unit impulse δ[n].
My professor hasn't been doing a good job of explaining this concept so far, please help!
AI: a.) Find the response of the system to 2u[n] + u[n-1]
If you have a linear system described by a response H, then you know that
\$ H(\alpha{}x_1 + \beta{}x_2) = \alpha{}H(x_1) + \beta{}H(x_2)\$.
Since the input you're being asked about is a linear combination of unit step functions, and you know the response to a unit step function, you can work out the response from this principle.
b.) Find the response to the unit impulse δ[n].
The Kronecker delta function used in discrete time systems has value 1 at n=0 and 0 for all other n. Therefore you can write
\$ \delta[n] = u[n] - u[n-1] \$,
and then you can use linearity again to find the system response. |
H: advice on a transformer for power-supply
i know this type of question is common and yes i could just buy a known transformer for $10 on ebay or something. either way :)
i am interested in building my own power supply, something variable around 3-30v dc and maybe with a digital voltmeter built in. i was thinking of recycling some components out of scrap devices that were headed for the recycling depot anyway. So i removed the power boards out of my old printer/scanner and my old cable tuner.
i did some continuity testing and checked resistance levels, my diagram shows the results of those tests. the windings that overlap in my drawing are just to illustrate where the pins actually are in relation to each other.
the original circuit used pins 1-6 as input and 7-10 as output.
So my question is, based on the image i drew up, how should i wire up this transformer to test it's output? can i just wire all three windings in parallel and see what the other two put out?
*edit
this one is out of my old printer. it was indeed run off 110v main. i powered it before butchering and checked voltages across the transformer inputs and was reading 114v. i read 115v before the smaller coil which was between the main and the yellow transformer.
is it strange that the voltage is rectified before the yellow transformer?
AI: If this was NOT a mains transformer then connecting mains to any winding will probably kill it and may kill you.
The transformers in the photos are NOT AC mains input transformers. They have RECTIFIED mains applied as DC and then a high frequency switching circuit uses this DC. Current flow in them is at very high frequency so their AC resistance = = impedance is high. If you connect AC mains to them directly they will "explode" at worst or simply die instantly at best.
What is required for simple AC mains to DIY low voltage is an "iron cored" transformer from a (usually older) piece of equipment that did not use a switching power supply. Older plug packs (wall warts) that are much heavier than usual are often a good source. Something suitable should be available at low or no cost.
Wiring windings in parallel and powering up = near instant death for the transformer in many cases.
You do not say which of the 2 devices (printer/scanner and my old cable tuner) this is from, or whether it was AC mains connected or via a plug pack (wall wart etc) or ... .
Please provide a photo of the transformer.
Stating model and brand of equipment concerned helps greatly.
Were these mains connected?
What is your mains voltage ? (110 VAC, 230 VAC, ...?)
What is the core made of? - ferrite, steel, ...?
How heavy is the transformer and how large? - Does it seem to be steel cored or something less dense?
Again, photo, brand, model will help muchly.
If the sample transformer IS an AC Mains transformer:*
IF you have another transformer with about 6 V*AC* output voltage you can try the following.
**MUST be AC out.
MUST be AC ...**
Identify windings in order of decreasing resistance (highest = A, next highest = B, ...)
Apply a voltmeter set to higher than mains AC to winding B.
Apply
LOW VOLTAGE
AC
about 6V
briefly
to winding A.
Note reading on meter on B, if any.
If meter flickers or has very low or no reading, move meter onto winding A.
Successively apply LOW VOLTAGE, AC to windings B C D E ... watching meter readings on A.
From the above tests you can get a "feel" for the relative winding ratios on the transformer. Some simple arithmetic will allow you to deduce the high and low voltage windings and what the rated voltages should be.
Think about it. Tell us what happens. Ask questions.
You asked:
what if i scrap the build from scratch project for now, would an omron industrial 24v 1.3a power supply work as a decent 'transformer' to take this ones place? then i can just add in a variable voltage regulator and meter, throw it in a nice wood box and be done for now. :) here is the particular model link octopart.com/s82k-03024-omron-8299
Less good long term.
The Omron supply is VERY expensive for what it does. Much better for much less is possible easily.
If you have one it could be used but it lacks what you need.
The Omron supply datasheet here - specific model PROBABLY on page 57, 3rd line, is apparently fioxed at 24V. 1.3Amax output.
To get lower voltages you will need to convert to the desired voltages with either a switching regulator or a linear regulator. Variable switching regulators are available at low cost on ebay, but add complexity to an already expensive product.
A variable linear regulator will work with moderate complexity BUT to get usual voltages of say 3V3. 5V, 12V you will waste MOST of the energy as heat.
At 5V the efficiency is 5/24 ~= 20%. 80% will be lost as heat. Worse at 3V3. Still bad at 50% at 12V.
Better is to either find a well priced supply that is variable and cheaper OR find a transformer that does what you want and start from there. We can advise if you wish to follow the latter path. |
H: Apply PWM signal to PIN of a Microcontroller
I am using the MC9S08DZ60. I have been give a circuit diagram according to which i must program the micro-controller. I am using Code warrior with Processor Expert which allows me to initialize the required registers, i don't have to write the code for the same.
Requirement from the code: Detect a PWM pulse on pin 0 of register D. In response, switch on LED and apply PWM signal on pins 3,4,5,6 of Register A. According to the datasheet, i have equated the value of the Channel value registers to the expected pin on the microcontroller. How to apply PWM signal at the required PIN ?I have made an attempt for the same in the following code.
Please refer to the given code:
unsigned int result;
unsigned int pwmSignal()
{
If(PTDD_PTDD0) // to check for the incoming PWM signal.
{
PTDD_PTDD2 = 1; //light up LED.
do // check Channel for 300ms.
{
//my understanding is to latch the values of the channel value registers to the
//expected pin.
result = TPM2C0VH;
result <<=8;
result = result + TPM2C0VL;
result = PTAD_PTAD4;
result = PTAD_PTAD5;
} while (TPM2C0_CH0F == 0);
}
else PTDD_PTDD2 = 0;
}
The code compiles absolutely fine. but i dont see any change.
At this point i wanna tell, this is my first attempt at doing this.
Also i have one more question, how do i use, for example PIN 2 of Register D, for two different operations in a single main.c ??
Please let me know if i can provide anymore data about all of the above.
Thanks in advance!
AI: There is a missing bracket between the while and else in your code, and an extra one at the end.
Here, like this:
unsigned int result;
unsigned int pwmSignal()
{
If(PTDD_PTDD0) // to check for the incoming PWM signal.
{
PTDD_PTDD2 = 1; //light up LED.
do // check Channel for 300ms.
{
//my understanding is to latch the values of the channel value registers to the
//expected pin.
result = TPM2C0VH;
result <<=8;
result = result + TPM2C0VL;
result = PTAD_PTAD4;
result = PTAD_PTAD5;
} while (TPM2C0_CH0F == 0)
} // here, this one is missing.
else PTDD_PTDD2 = 0;
}
// }
// ^ This one you added at the end isn't necessary.
It helps a lot if your code is indented correctly. I'm very surprised your compiler didn't complain about this. |
H: Is wire wrapping still used nowadays?
I know that wire wrapping was used in critical applications where reliability was a major concern because it is more reliable than PCB based assemblies. But is it still true?
The AGC (Apollo Guidance Computer) was wire wrapped but what about current designs?
Are mars rovers, space telescope or critical nuclear power plants systems wire wrapped?
AI: Occasionally, in some R&D lab, maybe, if they really need a one-off prototype and someone knows how to wire-wrap and has the tool and wire, and reliability isn't important. Otherwise making multi-layer PCB has just gotten too cheap and easy for everyone. Of course, multi-layer boards are much harder to fix than a rat's nest of thin wires, but with modern EDA software, are far more likely to be correct in the first place.
In some parts of the world where financial limitations and difficulty of access to markets force people to make do with whatever they have, it's no surprise to find old techniques in use. But google turned up no concrete anecdotes like that for WW. (Maybe I didn't spend enough time googling.)
More likely, WW is to be found in use by hobbyists with an itch to go retro, for example http://hackaday.com/2012/07/10/16-bit-hcmos-computer-is-a-wire-wrapping-wonderland/ where one commenter states "It’s rather zen, and an enjoyable way to burn a day – like knitting, basically." |
H: How do you run a 5v MCU circuit on a 12v car battery?
My Archery club has asked me to design and build a Traffic Light system for shooting, but they want it to run on a 12v car battery as this is what our previous system ran on.
I'm going to make the system using the pic18f4550 as the controller, so it can have an automatic mode as well as a manual mode, but this must run at no more then 5.5v. So I was going to use this 5v regulator circuit:http://thedasdet.deviantart.com/art/5v-Regulator-358912063
I'm worried that the 12v car battery will supply to much current and blow the regulator. If so what can I do to prevent this?
AI: Current is always drawn, not supplied: that is, connecting something that can supply a lot of current does not mean that it will.
The standard 5V linear regulator will work fine, but it will dissipate power as heat, proportional to the amount of current drawn by the PIC. I'd suggest something based around a "switchmode" power supply, or cannibalising a car USB power converter (cheap and widely available). |
H: Decreasing voltage without decreasing the current
I have got two 12 V 7.2 Ah lead-Acid batteries, which are connected in Series (26 V after charging). The batteries are connected to a step-up / boost module which have to be 2 V higher than the input. So the min. output is about 28 V
I want to use this to power an "mobile Amplifier", which is based on the compounds of an Logitech Z323 Speaker System. Now, my problem is, that the amplifiers input have to be between 14-18 V, but I can't get a lower output voltage from the boost module than the input voltage. In my opinion I could use a resistor combined with ohm's law. But the problem is, that the current-consumption of the amp (max 3 A) depends on the volume which is adjustable by a potentiometer.
Is there a way, to lower the output voltage to 14 V ignoring the actual current flow?
AI: With the componenets on hand, it seems like it would be simplest to use only one battery at a time, perhaps with a switch to choose between them. You could configure the converter for around 15-16 volts out for something in the neighborhood of 12v in, which would seem to satisfy the rule (at least the one you mentioned) about its output vs input.
A resistor seems like a quite poor choice, as in addition to the variable load concern you mention, it would simply be turning your limited battery power into heat. |
H: How to test if a Near Infrared Emitter and Photodiode still working?
I suspect that my NIR emitter and Photodiode are not working.
Emitter http://www.thorlabs.com/thorproduct.cfm?partnumber=LED1450E
Photodiode http://www.thorlabs.com/thorproduct.cfm?partnumber=FGA20
For emitter circuit, I connect it to 5V and a 200 Ohm resistor, to try to achieve a voltage drop of 1.2V and current rating of 20mA (according to datasheet)
For Photodiode, I tried to bias it as the circuit in the datasheet also.
Would you please showing me how to test if they are still in good condition.(For the NIR emitter, my phone camera cant capture anything).
AI: 1450 nm is far enough into the IR that most cell phone cameras won't see it. That's because the sensors are silicon CMOS or CCD sensors, and silicon sensors only respond to wavelengths below about 1.0 - 1.1 um.
You can check if your emitter is working using an IR viewer card like one of these:
The VRC2 and VRC4 models cover your wavelength. These have a flourescent coating that absorbs IR light and re-emits visible light so that you see a bright spot on the card when there is IR present. 2 mW, like your LED is rated for, should be plenty to create a bright spot on one of these cards.
If the emitter is working, but your overall system is not, then suspect the receiver.
The easiest test is simply to replace your photodiode with a new one of the same type and see if that fixes the problem. If it doesn't then you'll need to look at your whole receiver circuit, node by node, to see where the behavior is not what you expect. |
H: Open Source verilog synthesizer
I'm looking for an open source verilog synthesizer. I am using Icarus Verilog as a verilog simulator. Originally I was going to use it for both simulation and synthesis, but found out the tool no longer supports synthesis. I have found the gEDA website and I have looked around there, but was not able to find a replacement synthesizer.
I am doing this because I have a Papilio FPGA dev board and want to start to use verilog with it.
Also, if you could shed some light on the process from going from Verilog to FPGA that would be great. I feel as though there are more steps in the process from going from Verilog to FPGA than just simulation and then synthesis.
AI: Synthesis is highly dependent on the platform you're using and usually needs to be done by tools created by Altera, Xilinx, etc. Nothing open source exists (AFAIK) because this is so custom and requires a lot of effort to obtain optimal and correct results. Therefore, there's little incentive to do open source. Also, because of the IP, these companies don't share information about their chip internals, which prevents others from using them without going through the manufacturers.
By the way, Altera and Xilinx (perhaps others) provide free versions of their tools with some features missing you can use (which is another reason no one seems to do anything open source). They're good enough for many projects.
So, to summarize, do you think anyone would spend time, for no money, to create something that is difficult, with little information, when the manufacturer already provides some of it for free? Take a look at the open source BIOS for PCs. Hasn't gone very far for these same reasons. |
H: Is it generally possible to uniquely identify an individual MCU (for licensing purposes) (no MAC address available)
I am being asked to enhance the firmware installation program for an MCU (specifically, a Freescale MC9S12E64 - though I don't know if this matters).
The purpose of the enhanced installation is to limit the number of times the firmware can be installed. It seems the best way to do this would be to uniquely identify the specific MCU in use during firmware installation, in order to keep track in a central database.
If the MCU had a MAC address, this would seem to be feasible. Unfortunately, these MCU's have no network interface, and hence no MAC address. Looking through the manual for the MCU noted above, I cannot find an indication of a unique identifier for the MCU.
My question is: Do MCU's typically have unique identifiers associated with them - analogous to a MAC address - that can be obtained by software as firmware is burned into these devices?
AI: They almost all do, but they're not always accessible to the users.
I think your issue is more complex because you're trying to use it to enforce an installation. Please note that many of the DRM methods fail when a proper adversary attacks them (especially since you can't trust the microcontroller since the user has control of it).
A cursory search through the datasheet of the microcontroller failed to find any identifying serial. You should contact Freescale directly. |
H: Digital Compass identifying direction of travel for use with trains
I work in a control center for a train company in the UK. Our trains work in either direction but only one end has first class carriages. Because trains on our network reverse quite a lot it is difficult for us to track and advertise where first class will be.
Is it possible to create a device using a digital compass that will identify whether the train is travelling North or South and that can push this information via a GPRS transmitter so that it can be read on a PC? The device would be positioned at the first class end of the train with North pointing forwards. In theory If the compass direction is north and pin also north we would know that first class would be north facing. If the compass read out was south first class would be south facing.
I presume the main difficulties with this would be transmitting the information being read from the compass. Can anybody offer a solution?
AI: This could be very easily prototyped in it's entirety with a smartphone - you have the sensor, the programmable platform, and the radio network link.
Doing it that way with cheap off the shelf hardware matching a widespread developer skillset will let you explore the idea and start to discover what unanticipated issues might be lurking.
For example, you haven' been very clear about when the measurement will be taken. If the train is still in the station, it's possible the station tracks aren't really pointing in the direction of the journey. A solution based on data pulled out of your scheduling system should be weighed as well. |
H: Communicating by RS-232
I'm trying to communicate with a serial barcode scanner. This is how i've linked it to my computer (the circles represent the color of the wires already soldered in the serial plug) :
http://img441.imageshack.us/img441/6126/0079.png
When I scan a barcode (a special one telling the scanner to send an ASCII debug) or just a normal random barcode, all I can see in my serial terminal are accentuated letters and I don't understand why I can't see the barcode. I think the baud rate is fine, and I don't know if it's encoded or something...
Could you help me figure it out ? This is what I get :
ÍøÌÔÃøÃÇøÇËøËÊøÊÎøÏËøÊÎøÎÏøÏÓøÓÑøÑÖøÖøÔÐøÐ×ø×ÔøÔ
AI: The "FTDI friend" is the wrong tool for the job. What you want is a cheaper, off the shelf USB to RS232 converter from a generic computer or office supply store.
As Gustavo points out, the signaling voltage of the FTDI friend is incorrect - about 3.3v unipolar instead of the higher, bipolar RS232 levels used by just about anything of recent vintage that has a 9-pin serial cable.
However, that's not the only issue. The "sense" of the logic is also customarily inverted between logic level and RS232-level serial signaling. So even if there were not a potential damage issue due to the voltage incompatibility, the upside-down data would not be interpretable by a typical receiver.
It might at first seem ironic that a USB-serial chip packed with a a converter to RS232 levels and a 9-pin connector is cheaper than a module with just a chip and the signals broken out at logic level to wires, but not really, when you consider the size of the market for the two products. |
H: How can I reduce the power consumed with wall warts?
I have been designing a project that requires a 5V for some components and 12V for others. I am planning to leave this plugged in 24/7 so I want it pretty efficient. I know they don't waste that much energy, but I still want to make it as energy efficient as possible even if I don't notice a difference in my energy bill.
[A.K.A. This is for a friend that read somewhere wall warts waste tons of energy, but if it makes them happy, I might as well do it. I have seen this: How much power is really wasted by a wall wart? but my friend isn't happy with that. I just want a power efficient source. Also, this isn't related to How can I reduce power consumption of my device? because that is saving energy in theory.]
I have a couple of options to use:
Buy a 5V and a 12V adapter. Connect the grounds.
Buy a 12V adapter and use a voltage regulator and a cap.
Which one is better? Do some adapters/adapter types waste less energy?
Another problem is I might need 1/2A for the 12V circuit which is only going to be used 5% of the time. Does the higher amp converters use more energy when idle? Suggestions? I don't want to use relays because they would be dangerous. I would need less than .5A for the 5V one. Do I need to pick out adapters?
Thanks!
AI: I would go with a single mains-to-12V adapater, preferably one that's a switching model.
The switcher will waste less energy generating the +12V rail than the linear, and can regulate its output without dummy loads / burning power unnecessarily.
For the 5V rail, consider building a 12V-to-5V buck converter if the load current justifies it.
("Less than 0.5A" makes the decision less than clear - how much less than 0.5A? If it's 100 microamps, use a linear regulator. If it's 0.49A, you're probably better off with a buck.) |
H: Maximum clock frequency for multi-cycle vs pipeline
Suppose you have latencies:
IF: 10 ns
ID: 11 ns
EX: 12 ns
MEM: 13 ns
WB: 14 ns
What is the maximum possible clock frequency for a pipeline with this design? I found information online that suggests the maximum possible clock frequency is 1/c, where c is the latency of the slowest stage. Thus, we have 1/14 GHz. Is this correct?
Also, how does this differ from a multi-cycle design? If we had latencies:
Register read: 1 ns
Register write: 2 ns
ALU: 3 ns
Memory read/write: 4 ns
Wouldn't the maximum clock frequency also be 1/c, where c is the latency of the slowest stage? Thus, we would have 1/4 GHz.
In total, if my above calculations are correct, I'm curious as to why the multi-cycle and pipeline design internally depend on the same latency delay (the one that's slowest). Thanks for any help.
AI: Pipelined design: you are correct about 1/14GHz.
Multi-cycle: you can change the denominator. For your second example, you could have the ALU and memory stages take 2 cycles each, and run the whole thing at 2/4 GHz.
However, this affects throughput: if your ALU takes 2 cycles, you can't issue more than 1 ALU operation every 2 cycles. Whereas in your first example you can issue 1 instruction every cycle (assuming no stalls or branch mispredicts).
Multi-cycle designs are also a pain from a toolchain and verification perspective, as you have to tell all the tools "this path completes in 2 cycles, do not complain about paths that are longer than 1 cycle". |
H: 5v output to 3.3v?
I have a microcontroller and a Raspberry Pi, both running off of the same 5v supply, in parallel. The microcontroller has 4 5v output pins and the other is a Raspberry Pi, that can only accept inputs of 3.3v and less.
Obviously I cannot directly connect the outputs to the inputs - that'll fry the Raspberry Pi.
How can I connect 5v outputs to the GPIO pins on the Raspberry Pi?
AI: Use a level translator such as the one sold by sparkfun.
Hook one VCC to 5V and the other to 3.3V on the Rasberry Pi. |
H: How are these pcb pads made?
We want to design a pcb module that should be soldered directly onto customer pcbs (exactly like ICs ect.)
I found a module which does exactly that, please see pdf.
https://www.dropbox.com/s/ky2u9z83ja6snsh/pcb_pads.pdf
But how are these pads made i the pcb layout tool?
It looks like Plated through holes which has been placed half en pcb edge.
AI: Those are called Castellated Vias, Castellated Holes, or half-holes, depending on what your board-house likes to call them.
Typically to have them in your design, you simply place a pad in the middle of your board outline route path, and then simply let your board-house know that your board has castellated vias.
If you want unusual pad profiles, you may need to draw up a custom pad shape as a special component.
Generally, if you have any questions, you should talk to your board-house to see if they can indeed do castellated vias, and how they want you to indicate them on the PCB layout.
See the electronics.stack-exchange question regarding Castellated Holes here. |
H: Using touchscreen cellphone lcd module for custom projects
I intend to use the capacitive touch based lcd modules of cellphones in custom embedded projects,
I will be using this display with low cost stm32 boards.
Has anybody experimented with this approach ? Any ideas, links to datasheets ?
PS : I am specifically looking for touch integrated lcd modules, there is a hack available for nokia non touch modules already.
AI: It turns out to be easier, and much more cost-effective, to use LCD display + touchscreen integrated modules as sold on eBay or other sites, compared to using an LCD touchscreen from a cellphone.
For instance, this is a 2.2" TFT LCD with integrated touch panel, for $6.79 (approximately Rs.370) including free delivery to India:
If integrating the fine-pitch FPC connectors of such LCD panels is a problem, you can also buy compatible PCB adapters for such panels from eBay and other sites for as little as $3.99 (~ Rs.216) including shipping, which incorporate required support components, providing a standard 0.1" pin-out that can be used with your embedded development board / breadboard.
I have been using such touchscreen display modules on projects, and can report that they work well, and that the existing library support for most such modules, on the common microcontroller development platforms, saves a lot of time, effort and implementation risk, far outweighing any perceived value of jerry-rigging any display panel off an existing cellphone. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.