source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
Choosing a switching device I am overwhelmed with the variety of switching devices. MOSFETS/BJTS Relays(mechanical/solidstate),optoisolated solutions, etc.. I need to support 15V, 60A bursts, should be high efficiency, and switching time is not important since it wont be changing very often. Noise is also not a large issue.This will serve the function of a battery cut off in a circuit. Based on these requirements, what would you guys recommend? <Q> Almost definitely a MOSFET. <S> The only issue really is what voltage is available to drive it. <S> Let's say you have a 15V battery with a 5V on/off signal referenced to battery negative. <S> If the load needs to be grounded, you need to use a P-channel MOSFET with drain tied to the ungrounded end of the load, the source tied to battery positive, and the gate drive circuit may be a little more complicated ( <S> * = <S> I might post details later). <S> A 15V battery is small enough that you can get away with a MOSFET rated for 25-40V range <S> and there are super-low on-resistances that can handle 60A loads. <S> edit: you don't say what kind of packaging you are looking for. <S> If you are planning on using a circuit board for other things, go with a MOSFET in an SO8, DPAK, or D2PAK package. <S> SO8 sounds iffy for 60A loads unless it's for a really brief time, but it's probably the most cost-effective, though the worst for thermal dissipation. <S> DPAK and D2PAK are beefier. <A> I would suggest a mechanical relay. <S> There are relays for automotive uses that can handle your load. <S> You will typically need a small MOSFET or BJT to drive the relay coil (connect one end of the coil to +12V and drive the other to ground using the MOSFET/BJT). <S> You could use a high-current MOSFET <S> but I don't think you can beat the price and low losses of the relay. <S> edit: <S> JustJeff is right that when switching full 60A (especially if the load is inductive or the wires are long) the relay will need additional protection from inductive spikes to prevent arcing at the contacts (which may result in a permanently-on relay). <S> With a MOSFET you could try making the turn-off slower (the dissipation should not be an issue if you rarely switch) by increasing the gate resistor. <A> Interrupting 60 A is a non-trivial task. <S> I'd use a DC contactor, like those used in electric vehicles. <S> McMaster sells a pile of them: http://www.mcmaster.com/#dc-voltage-contactors/=72v7eh <S> In particular, I think part 7995K42 would work.
If you're not planning on using a circuit board, an automotive relay would probably be much easier to use. If your load can float and can attach directly to the battery positive, then you can use an N-channel MOSFET: tie MOSFET source to battery negative, drain to the side of the load not connected to the battery, and the gate to the on/off signal through a small (50-200 ohm) resistor.
Any advice on reading datasheets After my embarrassing mistake by having the component in backwards , I'm wondering if anyone has advice for the newbie (or expert) on reading datasheets. What conventions are there which aren't obvious. What's the first thing you should check when something's not working. What can I safely ignore and what should I worry about? Anything else? <Q> Read the datasheet carefully . <S> Details matter. <S> Be Humble: <S> Don't assume there is something wrong with the part right away, assume the problem is in the way you used it. <S> Frequently, I find that when things aren't working, I've either not read the manual well-enough, or I did something wrong. <A> Look hard at where pin one is. <S> Make sure you understand if the diagram is a top or bottom view <S> (top is I think most common). <S> To put this another way, some datasheets give you the dimensions of the part itself, and some datasheets give you the recommended land pattern (aka footprint, solder pads). <S> If they give you the dimensions of the part, they usually give you a top view and then bottom view. <S> When you're looking at the bottom, imagine you flipped the chip over with your hand. <A> Terminology <S> There is industry standard terminology <S> that has evolvedfor electronic components. <S> It is important to understand thedefinitions. <S> Absolute Maximum Ratings <S> Understand the limitations of thecomponent. <S> Specification Conditions <S> Although the terminology is standard thespecific test conditions for each specification are not. <S> It isimportant to account for these differences when (1) determining theproper component and <S> (2) when comparing devices. <S> Application Notes <S> Most datasheets have a variety of application circuits. <S> Reference Designs <S> A good reference design will demonstrate theproper application of a component and the proper circuit layout toachieve the specified performance. <S> Component Package Specifications <S> Review the componentpackages and the recommended PCB land patterns. <S> I have placed some additional details at http://wiblocks.luciani.org/FAQ/faq-reading-datasheets.html <S> I will try to add some details about the datasheetspecifications that deal with thermal calculations --thermal resistance, transient thermal response and switchinglosses. <S> There seems to be quite a few thermal questions(on a variety of sites). <A> Have another engineer review your work. <S> You will not catch everything. <A> This means that often times you have to look around to find a specific parameter. <S> Another thing about data sheets is that they usually only put the things that actually are important on them (unlike marketing material!). <S> Point being that it's usually worth reading the entire thing through, at least once. <S> If you really want to prioritize, check the 'absolute maximum electrical ratings' first. <S> This helps keep from frying the part. <S> You might defer wading through tables of timing parameters or expected waveforms, or look at selected ones first that relate to whatever basic function you're trying to get up and running. <S> But, even the application notes are often useful. <A> I like to print them out, or at least print the useful pages. <S> Scribble in the margins. <A> best advice i can give you is to read them carefully but take them with a grain of salt. <S> Don't just blindly do what they tell you, even with it comes to example circuits. <S> I've seen multiple datasheets with blatant errors in example circuits. <S> one famous one i remember called for a 470uF cap instead of a 470nF cap in a reconstruction filter, which the designer(me) followed without questioning resulting is a massive aluminium cap on the rev 1 pcb instead of a 0402 SMD package cap. <S> Also keep in mind that they are written by people who work on specific parts in specific sectors and usually have a distorted view of what the overall system design calls for. <S> A common example is devices that do A to D or D to A. <S> They will almost always call for separate and isolated digital and analog ground. <S> While in theory this is fine but in practice designing a PCB with segmented ground planes is almost always a terrible idea unless you have massive amounts of board space to play with. <A> All of the above answers are good and valid. <S> I especially like the point about being humble and looking hard at what you might have missed. <S> The only point I have to add is to look at Errata. <S> Often we read datasheets and specify parts for our design, quite early on in the project. <S> It can be a month at the very least before we actually have a fully populated board. <S> :) <S> During such time, often chip manufacturers find slight issues with their parts, and update the Errata for these parts. <S> Most often than not, they usually specify a workaround for the problem which we might need to incorporate in our design. <S> Unfortunately, I learnt the hard way, after months of trying to debug an issue, read the datasheet over and over, and then found that I had not read the errata. :)
One thing with data sheets is that the manufacturer usually goes out of the way to make everything obvious.
3d modelling software for case design What software is generally used in industry to design cases for pcb boards? <Q> Solidworks: $4000 + $1300/year <S> ProEngineer: $5000? <S> + something per year? <S> Autocad Inventor: $5200? <S> + something per year? <S> Google Sketchup: <S> Free or $500, but can't export STL directly. <S> I've seen mention of a plugin that can convert Sketchup files to STL, but I haven't used it myself. <S> (From Peter Gibson) Blender: <S> Free, but alleged to have a steep learning curve. <A> SolidWorks <A> Take a peek at Alibre Design. <S> It's more affordable than the other options, and has a free trial. <S> I bought it recently and I'm very satisfied. <S> Not only it meets all of my needs, I compared it to Rhino, SolidWorks and others and found it way better, both in capabilities and user interface. <S> http://www.alibre.com/products/mainpage.asp <A> auto-cad Inventor. <A> I would also recommend Alibre Design PE, which is a bargain at $100. <S> I'd also like to add another option that is free (just like Blender), called OpenSCAD . <S> It is highly capable, and for doing simple PCB enclosures, I would pick it over Blender anyday because it's so much easier to understand. <S> In many cases (pardon the pun), I would use it instead of Alibre Design because you can share your designs more easily with the community. <S> It exports STL and DXF as well. <S> There's something really cool about changing a few variables in the code that generates your model, and getting back a new part that fits a new PCB. <S> Tweaking due to measurement errors is just as easy, provided that you wrote the code properly. <A> At my university the students use Solidworks to design cases to house my PCBs. <S> But as that is very expensive I would try Blender first if it is just for home use. <A> Apparently K-3D also does STL export, and it's quite a lot easier to use than Blender. <S> http://www.k-3d.org/wiki/All_Plugins <A> You can use FreeCad <S> According to their site: <S> FreeCAD is a general purpose parametric 3D CAD modeler. <S> The development is completely Open Source (LGPL License). <S> FreeCAD is aimed directly at mechanical engineering and product design but also fits in a wider range of uses around engineering, such as architecture or other engineering specialties. <S> It is a feature based parametric modeler with a modular software architecture which makes it easy to provide additional functionality without modifying the core system. <S> As with many modern 3D CAD modelers it has many 2D components in order to sketch 2D shapes or extract design details from the 3D model to create 2D production drawings, but direct 2D drawing (like AutoCAD LT) <S> is not the focus, neither are animation or organic shapes (like Maya, 3ds Max, Blender or Cinema 4D), <S> although, thanks to its wide adaptability, FreeCAD might become useful in a much broader area than its current focus. <A> I had the same need and went with SpaceClaim. <S> Alibre, Autodesk Inventor and SolidWorks share the same basic philosophy with increasing capabilities and cost. <S> They are all in my opinion old-fashioned, clunky and takes a lot of time and effort to learn. <S> The reason we went with SpaceClaim is that it is much easier to use, you can work entirely in 3D if you want, you don't have to go back and forth between 2D and 3D. <S> It is not history-based, meaning it "understands" most geometry better. <S> Most other modellers rely on history and without the history you often have to recreate a model from scratch if you need to edit it. <S> SpaceClaim also includes IDF support so you may be able to import your PCB and design around it. <S> Before SpaceClaim we used SketchUp, which is similar in terms of ease of use. <S> I like SketchUp a lot, but it is not a solid modeller and is lacking in precision and features. <S> But it's great for its price if you are ok with a surface modeller.
SpaceClaim is less expensive that SolidWorks or Inventor. FreeCAD features tools similar to Catia, SolidWorks or Solid Edge, and therefore also falls into the category of MCAD, PLM, CAx and CAE. Generally, you need software that can export STL files.
Battery life monitor on PIC circuit I have a small circuit using a PIC18F14F50 microcontroller chip which is logging data into an external EEPROM chip over an i2c interface (which I can then read back later over the USB interface). One sample is recorded every 15 minutes and doesn't need to be particualrly accurately timed. It's ok if samples are missed or mis-timed while batteries are being changed, but it's not great if the batteries expire and no data is recorded for several days until someone notices. So I'd like to warn the user when the battery is low in plenty of time for them to replace them. The average current is under 2mA and I'm running in from 3 AA alkaline batteries in series to give 4.5volts so I'd expect them to last quite a number of days. But I'm wondering how to detect that the battery is low? I presume the voltage will drop as the batteries reache the end of life. I'm thinking that this PIC has a 1.024v reference voltage so I can divide down the supply voltage and feed it to an analogue input and when the divided voltage drops below that trigger a warning. But I don't know enough about batteries to know how well this will work? And I don't know what voltage to choose that would indicate that perhaps 10-20% battery life is left. Will that even work at all? Is there a better approach? This doesn't need to be at all accurate, I just want to give a good warning in plenty of time without getting people to disard batteries that still have life left in them. As my current usage is fairly constant, would a simple timer be reasonable if I can work out how long the batteries last on average and then pick 85% of that time before I give the warning? Or does battery life vary more than that? Any thoughts would be welcome. <Q> First, let me comment on the timer circuit. <S> This will work, as long as your batteries are all of relatively the same age and kept in the same conditions. <S> In 6 months when you are still using this and your batteries are all 6 months older <S> you will need to update the timer. <S> Functional solution, but not the best one. <S> You can divide down the voltage for your input with a resistor network that has a high enough voltage not to affect your lifetime(you <S> can use a network that does load, you just replace your batteries more often). <S> There is one catch, you need to Load a battery to see a true value of it's life left. <S> You will find the more loaded a battery is the more the discharge curve looks like a line. <S> It will never be a line, there will still be clear phases, but you can dependably correlate a loaded batteries voltage with your life left. <S> Have the pic spend time measuring your battery and look at the resulting voltage curve until your device dies. <S> If the curve stays relatively flat, and then suddenly drops and your batteries die <S> then you will want to use a transistor and load resistor to increase current draw during battery measurements. <S> There is a large amount of information on batteries on battery university. <S> Often microcontrollers fail to pull enough current to get a curve that is sloped the entire way(I have seen this problem with ultra low power uC like MSP430). <S> You will probably be fine with just your PIC running. <S> Research into AA battery chemistry has fielded some results. <S> It does look like they show pretty flat discharge curves with low currents(<500 mA). <S> This will mean that you will likely want a resistor discharge circuit coupled with a transistor to allow the voltage measurements to be more valuable. <S> Please forgive me if this was not clear enough. <S> If you comment and questions or suggestions I will update it. <A> Yes, the battery voltage will drop, but the drop is small, say half a volt: <S> If you use a voltage divider to get this into the ADC range, you're dividing the range as well. <S> I guess this is still measurable with the ADC directly. <S> 5 V / (2^10) = <S> 0.005 <S> V, with ± 3 LSb offset and gain errors, so there are still a number of measurement levels between full and empty? <S> To measure battery charging and discharging accurately, people keep a log of how much current is being drawn with a current-sensing resistor, and decide that the battery is low after a certain amount of charge has passed by. <S> If your current draw is relatively constant, then yes, you could just use a timer to do the same thing. <S> Run it a few times, measure the amount of time until you consider the battery to be dead, and then use a timer in the future to guess when it's about to die. <S> You are using fresh batteries each time? <A> I think the only solid way to monitor a system like that is a kind of watchdog-like arrangement <S> : Have some other, separately powered , system check it from time to time (or wait for a signal) and if it's not responding, alert. <S> You could also use that separate system to check for the battery instead. <S> It won't suffer from the main battery being dead which will kill any monitoring system running off the main battery. <S> If you don't want or can't have a second power source, the other comments seem to contain very good suggestions for self monitoring. <A> You can get a much more accurate voltage reference with an op amp (use one with an enable pin, so that it can easily be shut off), and just tune your circuit to the voltage range you want to measure: 0V at 0.8V, and 3.3V at 1.1V. <S> If it's saturated, you know that you've got plenty of charge, and you don't seem to need a monitor, just an alarm. <S> Also, make sure that you measure several times (or use a current sense resistor), rather than assuming that a drop in voltage is caused by a dying battery. <S> It's not - battery voltage is dependent upon both discharge current and remaining charge. <S> A current spike can cause a big drop in voltage, but the battery will recover when it is removed. <S> See Figure 9 of Energizer's alkaline datasheet. <A> If possible measure the voltage of an AA Alkaline battery just after it has been loaded by your normal load (device) and you stopped the load current, when it drops below 0.9V per AA battery your batteries are depleted. <S> I do this <S> is many products I designed <S> and it works perfect. <S> Normal Alkaline batteries will recover after a load has been removed but this takes time depending on the load current. <S> Sometimes this can be minutes or even hours depending on temperature and load current. <S> Measuring it during steady use with a small current you will have to take a higher voltage depending on your current but normally 1.2V is OK for a device using only 5mA.
If you can arrange a battery monitor that will run on a small battery like a coin cell and guarantee that it will outlast the main battery, that should do the job. If your PIC is on during the measurement you will probably get a decent measurement.
Cheapest ARM with an MMU What is the cheapest ARM processor with an MMU so I don't have to use uCLinux?Bonus for non-bga and integrated RAM/Flash <Q> The Atmel AT91SAM9260B comes in a LQFP package and may be a little bit lower in price than the SAM9G20. <S> It has a MMU and the same peripherals as the SAM9G20 but runs at 200 MHz rather than a max of 400 MHz. <S> Pay attention to the details in the Atmel Application <S> note Schematic Checklists and you will be successful. <S> You could also try the AT91SAM9XE512 with flash on-chip. <S> But 512KB isn't going to be enough even for uCLinux, so the most cost effective thing to do is use the flash-less SAM9G20 or SAM9260B with external flash and SDRAM. <S> http://www.atmel.com/at91 <A> I think the answer is chips in the ARM926EJ-S family, like the AT91SAM9G20 . <S> The G20 costs around $10 in relatively low quantity, and it has an MMU. <S> Unfortunately, it's only available in a BGA package, and you'll need external memory. <S> The good news is that the ball pitch on the G20 is 0.5 mm (edit: there's a 0.8 mm pitch version too), which is just within the limit of what most assembly houses will do without a surcharge. <S> If you go to an ARM Cortex A8, like the OMAP35xx, you have to deal with 0.4 mm ball pitch. <S> There are at least 5 companies that are making SBCs using the G20. <S> Here are a few: Emac SoM-9G20 , Illinois, USA Taskit Stamp9G20 , Berlin, Germany Propox MMnet1002 , Poland <S> (I'm actually working on an open hardware board based around this chip, but it won't be ready for a few months at least. <S> But that at least explains why I have all this crap in my head!) <A> It's non-BGA, but doesn't have integrated RAM/Flash. <S> http://opencircuits.com/Linuxstamp <A> <A> There are two another choices there: 1. <S> Vybrid VF3xx ARM Cortex-A5 family from Freescale (now NXP), main features: 266MHz, 1.5MB on-chip SRAM, 2x Ethernet + L2 switch, LQFP176 . <S> 2. <S> RZ/A1 ARM Cortex-A9 family from Renesas <S> , they have few ICs with LQFP package (176, 208, 256 pins), and large on-chip SRAM (3MB-10MB), 400MHz. <S> You can get it from DigiKey for example.
The AT91RM9200 used to be a popular choice (ARM9 + MMU). The imx233 freescale processor costing around 10$ and is available in 128LQFP package
Where do I start with embedded video? My boss recently asked me how difficult it would be to design a product that could continually record fairly low quality video and store the last few hours in some form of internal memory. I have never done any development with video before. Where would be a good place to start my design? Do you have any suggestions for an MCU? I have been using Silicon Labs MCUs lately for other designs. What would be the best camera type to use to keep the project as simple as possible? What format would be best to store the video in? Would I need a video codec or is that only need for a device that supports playback? This device would probably just need to be able to transfer the video to a PC for playback. Any insight you can offer would be much appreciated! ADDED: I have been looking on digikey at CMOS Image sensors. I see that there are several on there made by a company called OmniVision. These data sheets say that "The captured data can be transferred either by a standard parallel digital video port (DVP) or by a single-land MIPI high-speed serial interface". I have never heard of either of those. How do you go about getting that into an image file? using C? <Q> Have you seen CMU cam? <S> http://www.cmucam.org/ <S> Is this the sort of thing you had in mind? <A> For really low quality (and cost), you could try hacking a GameBoy Camera. <S> http://sophiateam.undrgnd.free.fr/microcontroller/camera/index.html <S> Perhaps, just writing raw frames to a big SD card. <A> It's made by COmedia , and the one I've used is called the C328-7640, but I think they've discontinued it (according to SparkFun anyway), with a successor "in the works". <S> At any rate, you could easily interface with this type of thing directly with something like an Atmel AVR (or Arduino for that matter), and you can also interface with an SD card with that same chip (using the SPI interface)... <S> you'd just need some FAT32 library code to make the card readable in something like Windows. <S> I haven't done that myself, but I've seen AVR and Arduino-based projects that have done it. <S> With a system like this I think you'd end up capturing and storing a sequential JPEG images, and then you could post-process them in windows to create Motion-JPEG file that would give you video. <A> The parallel digital video port (DVP) is a SGI thing. <S> See here for the spec.
There's a pretty neat UART camera module that you might be able to use for this as well.
Wiring a Arduino to a 12v TTY I have a DSC-1555 Alarm system that I am trying to wire up to an Arduino-Mega the problem I've run into is that the DSC uses 12v TTL to the Console and the Arduino uses 5v TTL. I was just guessing to use some resistors but I want to double check before trying. <Q> You'll need to convert the DSC-1555 Alarm systems 12V levels down to something the Arduino can handle. <S> Without having prior knowledge of how the DSC-1555's serial hardware works, there's not much I can say. <S> I'd get a hold of the datasheet and get more info. <S> Is it RS-232C (or some other revision) <S> compliant? <S> If so, you should get a 12V RS-232 -> 5V line converter. <S> You could try "stepping down" the voltage with resistors to something the Arduino can handle, but this is fraught with problems, as the signals will likely be inverted and may be outside the range the CMOS chip can handle, potentially causing damage. <S> If it's RS-232 compliant, get a converter and your headaches will be far less. <A> Regular RS-232 levels are spec'd at -3V to -12V for the 'marking' state (logic '1') and +3V to +12V for the 'space' state (logic '0'). <S> A typical device isn't going to cover that entire range, for example, a PC serial port might give you a -11.5V mark and a +11.2V space, while another device might give you -9 and +9. <S> TTL levels on the other hand are spec'd at logic 0 being less than 0.8V and logic 1 being more than 2.4V, although with CMOS devices logic '1' wants to be as close to the supply rail as you can get it. <S> There are a number of chips that will change between 5V logic levels and +/-12V <S> RS-232, that are quite cheap, and even work without an extra 12V supply. <S> You could check out parts like the ones <S> Maxim makes. <A> "Real" serial ports use the EIA-RS232 standard of +/-12v volts which allows quite long cables. <S> Lots of embedded gear uses the TTL logic levels of 0/5v, as this is much simpler but can only be run a metre or so. <S> Sometimes you can cheat and connect TTL outputs to an RS232 input, even though this violates the RS332 spec. <S> I wouldn't recommend going the other way and connecting 12v to a defenceless uC expecting 5v, though. <S> The reason for the use of 12v and -12v is noise immunity---5v <S> serial lines only work over short distances before the noise overwhelms the signal, while RS232 can run up to 10m or more. <S> Traditionally the line drivers/receivers used to convert TTL to RS232 <S> require <S> +/- <S> 12V power. <S> This is the main reason there is a -12v line on a PC power supply. <S> For 5v only systems, the Maxim MAX232 is the defacto standard for RS232 interfacing--this chip uses capacitor charge-pumps to generate +/- <S> 12v from a single 5v supply. <S> If you aren't up to building a MAX232 interfacing circuit you can buy one pre-built from futurlec for about $5: <S> http://futurlec.com/Mini_RS232_TTL_5V.shtml <S> I can provide a work-alike single-sided PCB layout for a TTL<->RS232 converter, if anyone is interested, as I built one a while ago to use when prototyping serial interfaced projects.
It's a little unclear what you're interfacing with, exactly, but if it comes down to getting 12V RS-232 levels in & out of an Arduino (or any other 5V logic), it's not all that difficult.
What may cause a perfboard to bend? I've just finished to solder this little circuit on perfboard and now I realize that the board is bent: I am pretty sure that the board was flat when I purchased it. What may cause this bending ? excessive heat ? there are some long solder bridges in that part of the board; is it possible that the solder shrinks when getting solid/cold ? Edit: Those boards are sold as "bakelite" boards at a local shop. I'd say they are low quality boards (eg. the solder pads tend to come off easily) <Q> I have noticed that perfboard does all sorts of bad things: corrosion, bending, peeling, etc. <S> It even bends when stacked neatly in a pile and is not in use. <S> (Plywood for example often warps when one side is exposed to air and the other is not.) <S> My recollection is that it is made of FR-2 <S> (synthetic resin) and not FR-4 (bonded epoxy) like commercial circuit boards, and is not as stable a base. <A> I think you actually hit the nail on the head at the end of your question: it possible that the solder shrinks when getting solid/cold The coefficient of thermal expansion of solder is around 20 ppm/C, meaning that when you heat it up 200 degrees C to melt it, its length increases by a factor of 200 * 20 <S> * 10 <S> ^ <S> -6 = 0.004. <S> When it cools, it grabs onto the perfboard, and then the length decreases that much. <S> You could probably calculate the radius of curvature of the board, knowing the length of contraction and assuming it will bend into a circle. <A> It's not very stable stuff, because of all those holes. <S> I think it's caused by having all the components on the same side, and all the connections on the other side. <S> I've had large four-layer PCBs warp during manufacture for similar reasons - unbalanced copper areas on the outer layers. <S> Boards made by another supplier were OK, though. <A> These boards are fiberglass and epoxy laminate. <S> When heated above their glass transistion temperature, the epoxy will become less rigid and more ' <S> rubbery' resulting in warpage and permanent deformation. <S> Perf boards which are usually made with cheaper and thinner materials than most other PCB's will warp with heat greater than 140 deg C. <A> It could also be the way you had the board clamped when you solderedthe components. <S> If the board had a bend when it was clamped itmay not be able to "spring back" after the components are soldered. <S> What type of board are you using? <S> If you are using epoxy-paper Iwould switch to epoxy-glass. <S> It should spring back a lotbetter. <S> It also is less likely to crack and break. <S> I like Vector 169P84WE. <S> The parts I use for breadboardingare listed at the bottom of http://wiblocks.luciani.org/FAQ/faq-tools.html
Not clamping the board could also cause the problem. So I think the best answer to your question is "it just does", or perhaps "it uses cheaper, less stable laminate methods, and all laminates are at risk of bending."
Can you run a BLDC motor backwards without damage? Can you run a BLDC motor backwards without damage? Is it OK to drive a model airplane BLDC engine backwards while landing, so it gets a little "reverse thrust" and come to a stop a little quicker on the runway? Is it OK to drive a model helicopter BLDC motors backwards so it can hover upside-down? Or do I need to design the hardware so that it never drives the motor backwards, under any circumstances, no matter what the pilot on the ground does at the transmitter? <Q> BLDC motors usually just use permanent magnets on the rotor (be it in-runner or out-runner) and use a set of windings on the stator connected in a three-phase delta or wye configuration. <S> The speed controller just generates a variable-frequency, three phase waveform to power the motor. <S> Since the windings are symmetric, electrically there's no reason you can't turn the motor in either direction. <S> As for whether it's a good idea to run a prop backwards on landing, that's more of an aeronautics problem than anything inherently electronic. <S> Having flown some r/c planes, it seems to make sense to me that if you reverse the prop on landing, you're basically just applying a braking force along the line of the axis of rotation. <S> If that line passes above the center of gravity (not below it), that should torque things so that the tail will stay down, so you should be stable if that's the case. <S> If the prop axis is below the CG, though, you're looking at forward torques that would drive the nose down, which would result in damage. <A> Yes, you can drive a brushless DC motor in both directions. <S> See, for example, the On Semiconductor MC33035 brushless DC motor control chip, which has a pin to control direction. <S> Here's a little explanation from p. 9 of the datasheet : <S> The Forward/Reverse input (Pin 3) is used to change the direction of motor rotation by reversing the voltage across the stator winding. <S> When the input changes state, from high to low with a given sensor input code (for example 100), the enabled top and bottom drive outputs with the same alpha designation are exchanged (AT to AB, BT to BB, CT to CB). <S> In effect, the commutation sequence is reversed and the motor changes directional rotation. <S> I believe you do have to be careful about "shoot-through"-- if you're trying to switch the direction of current flow in a winding, you have to be sure to turn one set of FETs off completely before you turn on the other set, or you may inadvertently short your power supply. <S> You might google "adaptive gate drive" or "dead time" for more details. <A> What you have to worry about most when you reverse direction of a motor, is that you do not put too much current into either the motor or the electronics/switches that control it. <S> When you connect a voltage source across a motor that is at rest and either has a large inertia or a locked rotor, you get a large current flowing through it = <S> V / R where R is the stator winding resistance of the motor. <S> This is called the stall current. <S> If you are running at full speed with a voltage source across a motor, and you immediately reverse the polarity of the voltage source, you can get up to 2x the stall current, because the voltage source is then at the opposite polarity of the motor's back-emf. <S> This can be too much current, and if that's the case then you have to control the rate at which you reverse voltage across the motor, by using PWM or some other way besides a hard voltage reversal. <A> Thrust on helycopters is controlled by varying the propeller pitch, not the motor speed/direction. <S> In an helycopter, the main rotor motor turns almost always at the same speed. <S> Inverted hovering needs a special designed swash plate that allows positive and negative blade pitch. <S> Stopping it quickly (with a propeller connected to it), change direcion to the thrust, and keeping your plane on the track, is another story :-)
For the original question, yes, you can drive a brushless dc motor in both direction.
Small batteries for use in cold (but not freezing) environments? I'm building a small, low-power device that will be used inside a standard consumer refrigerator (approximately 2°C). I've had trouble with Alkaline batteries at low temperatures, and was wondering if anyone has any recommendations for cells to use under these conditions. How do Lithium coin cells hold up, for instance? The datasheets I've found for them don't seem to take temperature into account. Update: it looks like I'll have to source ~50mA for short bursts, so the low-end lithium manganese dioxide cells I've been using aren't going to cut it. Any other suggestions? <Q> I would suggest a lithium CR2032 battery. <S> feel free to pick a large package or place a few in parallel. <S> Lithium Polymer will have lower capacity at lower temperatures. <S> However, to quote battery university, "Lithium-ion works within the discharge temperature limits of -20 <S> °C to 60 <S> °C (-4°F to 140°F)." <S> As a side note, they often list 1mA <S> as maximum current on one of these, but they can handle 10mA without much of a battery life <S> loss(this will be worse at lower temps), pass 10mA <S> and you will be killing batteries right and left. <S> Here is an example of a discharge curve based on temperature. <S> It is the second page of the data-sheet. <S> There is a clear decrease in life(~25%), but you should still be very able to use the battery. <S> It looks like -20 degrees <S> C is where you start to have large reductions. <S> Please let me know if there is anything I can add to make this more clear or more valuable to you. <A> I would not recommend the lithium batteries for low temperature applications. <S> I'd recommend Nickel-Cadmium (Ni-Cad) batteries, as they have have the best temperature range of any of the typical batteries, They also have very low internal resistance (less than half that of a NiMH) and therefore have very good maximum currents (think of an electric drill). <S> Some things to watch out for are their memory characteristic (Don't recharge it before it's almost dead, or you'll lose the capacity you don't use) <S> and the fact that they contain toxic cadmium. <S> You might have some trouble trying to do a dT(emp)/dt(ime) cuttoff, and they don't have a great -dV/dt characteristic either. <S> Another idea (if you own the fridge) <S> - Can you just open up the temperature control panel and light at the back of the fridge, get at the power source, say, for the light (before the switch, if you want it to be running when you close the fridge), and stick in an outlet or a couple (INSULATED! <S> WELL INSULATED!) <S> spade terminals and plug in a wall wart? <S> That's what I'd do, rather than messing with batteries. <A> If your device works continuously, don't worry about the performance of lithium batteries at charging and discharging. <S> they just have a lower capacity which you can check in their data sheets. <S> But if you using battery some in a while and you will have a voltage drop in the start because of passivation. <S> The only way to avoid this problem is to take a higher current in start, for example, with a resistor, and then continue with regular condition.
They suffer badly from low temperature, more than either the alkaline or NiMH chemistries. Use a decent charger or charge IC, and you'll be fine.
Need help understanding external power on Arduino I have an Arduino microcontroller. I wanted to control a few servos for an example project but I soon found out the Arduino can't give it enough power. I don't understand how to power something externally but still use the Arduino to control it. <Q> I think you may not fully understand how the servo works. <S> Most servos have a power, ground, and PWM line. <S> The PWM line will pull very little power. <S> This line is what the microcontroller will actually be controlling. <S> The Power and Ground lines are where the servo actually pulls its power from. <S> The power line can be connected to anything as long as the ground lines are at the same potential as the Arduino. <S> If you are using an Arduino in an IC form (ie: breadboard) then you will need to make sure what ever you are using as your voltage source (power supply, battery, voltage regulator...) is at the right Voltage level and can handle the current of the servo. <A> There are several ways to do this. <S> I suggest you read the following excellent tutorial: http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads <A> As @Kellenjb says, power your servo directly from your main battery/plugpack. <S> Connect servo ground to same ground as arduino, servo power to your power supply (or a separate regulator if your power supply voltage is too high for the servo) and connect the servo's control line to the arduino. <S> If you are powering the arduino over USB, there's only enough power available on the USB interface to drive a small servo, so you should consider a separate power supply. <A> You might want to look into the Motor Shield from Adafruit ( http://www.ladyada.net/make/mshield/index.html ). <S> It gives you an easy way to add an external power source.
If you are using an Arduino board, the voltage regulator that is on the board is limiting your power to the servo and not the microcontroller itself.
How do you find high-quantity prices for ICs? I know of findchips.com , oemstrade.com , octopart.com , and the like. But even the lowest prices on these sites are still higher than the prices on BOMs I get from China. How do you realistically estimate the cost of an IC purchased at high quantities for manufacturing purposes? <Q> Generally be careful of just getting full BOM pricing from China. <S> I usually let them handle generic parts, resistors, capacitors, generic diodes, generic transistors. <S> That type of thing. <S> Production houses usually buy such parts in the 100k + lot size making them hard to beat. <S> When your prototypes come back for checking i strongly urge you to test the parts they used. <S> Its not uncommon for them to slip in 5% parts in place of 1% parts. <S> If there are parts where the exact tolerance or dielectric is critical i would supply these yourself. <S> If you have a good relationship with the production house, you can let them source some of the IC's as well, common parts like op amps they can usually handle but again, test, test, test to make sure its not some relabeled piece of crap. <S> For the rest of the parts, i usually go with a major part supplier. <S> Arrow is my favorite so far. <S> They have a wide array of parts they stock, maintain warehouses and contacts in China to work directly with manufacturing and my local contact is very responsive and happy to dice up the order however I want. <S> What i normally do is get a full BOM price from both arrow and the manufacturer. <S> Then i sit down and cut up the BOMs based on who is giving the best prices. <S> Then i move anything that is on the China order that i'm concerned about the quality of over to arrow if the prices are reasonably close. <S> You may find that after a few runs you feel more confident and have a better relationship with your China manufacturer <S> , at this point you may want to move more part sourcing to their end. <S> There absolutely are some trustworthy and capable production houses over there, there are also some very shady operations. <S> Another recommendation for dealing with Chinese manufacturing: Be very, very methodical with your test procedures. <S> Use simple, direct language and lots of photos and diagrams. <S> Remember that the average test technician probably doesn't speak much English. <S> Don't expect that they understand what the circuit does or be able to provide much debugging value. <S> They are very efficient at testing given a solid procedure but generally don't have the time to understand your circuit or put much thought into attempting debug solutions. <A> For large quantities you work with distributors. <S> Distributors are important, not just for ordering parts, but also for support . <S> When I have to select parts the fact that there's a distributor with knowledgeable FAEs plays an important role. <S> Prices are the result of negotiations . <S> It helps if you and the distri know each other, a purchase history will probably get you a more interesting price. <S> Loyalty pays off. <S> My experience with Belgian distris is that it's a small world, sales engineers from one distri know colleagues from another one, and they often know more about your orders with other distris than you would appreciate. <S> Working with a few big distris who have a big portfolio can have the practical advantages of one-stop shopping, but you can also negotiate package deals . <S> On one occasion I negotiated a very good price, but that was for 100k controllers/year, which we didn't need. <S> The deal was closed at this price however, because we also needed a few other microcontrollers, and taken those together we reached the 100k turnover. <S> Bottom line: <S> every supplier-customer situation is different, that's why you won't get a firm quote for large quantities. <S> It's all about negotiating. <S> edit That was for ICs <S> (that's what endolith asked). <S> Common passives like 0603 <S> 10k\$\Omega\$ resistors we don't even take in stock, but we let the subcontractor that populates the PCBs use them from their own stock. <A> Starting to have that dilemma myself - trying to price out some kits. <S> If China prices are cheaper than the manufacturer you could be getting some ... sub-prime quality components, or slugs . <S> Would love to hear what anyone else has to say about this as well. <A> From franchised distributors: Arrow Avnet Digikey , pricier but quick to ship <S> You will need to get quotes; they don't put this stuff online for "real" (>1 k) quantities. <A> You need to talk (and I mean talk - some still don't answer emails!) <S> to franchised distributors, and if necessary play them off against each other. <A> High-volume pricing is a negotiation, not a quote. <S> The closer you are to an actual purchase the more accurate the pricing will be. <S> Keep in mind that the sales rep's job is not just to close the sale but to get the highest price possible. <S> Very high volume pricing is essentially a trade secret, because sellers don't want buyers to know how much profit margin is available to be negotiated away. <S> Nonetheless it's hard to keep such information completely secret. <S> You can ask around to people who have access to actual pricing, such as the app engineer, your component engineer, purchasing department, engineers on other projects or in other jobs, teardown reports on competitors, etc. <S> It helps to keep after the latest information because pricing can change a lot over time due to supply availability or industry trends. <A> A rule of thumb which we used to use for high-volume prices was to take the Farnell 100-off price (Farnell is a UK catalogue company) and halve it. <S> This doesn't really work for high value semiconductors, but it's ok for commodity stuff.
Pricing will depend on quantity - contact the manufacturer directly, e.g. Maxim will sell DS1307 real time clock ICs for US$1.36 each for 1000+; retail here is A$3.62 (ex) each for 50+.
At what current and voltage do typical resistors explode? I don't have an explosion chamber, so I cannot test critical values. If you explode resistors with too high current-voltage combination, does it damage your equipment, such as multimeter and DC-supplier, even in the explosion chamber? How do I notice when a critical point for resistors is achieved, not touching the hot component? I want to test a Zener diode for increasing voltage. I have a great amount of different diodes, but I have no idea which ones are Zener diodes. Which resistors and Zener diodes should I use and how do I find the right ones without exploding them? <Q> In my experience, resistors and diodes burn, but they don't explode. <S> The only components that I've experienced exploding are tantalum capacitors when placed with the wrong polarity and transient voltage suppressors ("tranzorbs") when exposed to ~2x their rated voltage. <S> To determine which resistors or diodes to use, you can check their power rating. <S> For example a typical through-hole resistor is rated for 0.25 W. Depending on how you're using the resistor, there are three equations that are useful to calculate the power dissipation: <S> Watts = <S> volts <S> * amps <S> Watts = <S> volts <S> * volts / ohms <S> Watts = <S> amps <S> * amps <S> * ohms <S> For example, suppose you have a 10k resistor that you're using as a pull-up resistor for a pin on a 5 V microprocessor. <S> The maximum power drawn by the chip through the resistor (by equation #2) will be 5 * 5 / 10000 = <S> 0.0025 W, or 2.5 mW. <S> That's fine even the tiniest surface mount resistors. <A> Manufacturers typically give a maximum voltage for a particular resistor range, such as 200V for a 250 mW resistor. <S> That needs to be taken into account, as well as the power. <A> The maximum voltage has more to do with the package dimensions than blow-up issues - if the maximum voltage across the device is exceeded it may arc across the terminals effectively bypassing the device. <S> Resistors can fail both open and short depending on the nature of the stress exposed to it. <S> A typical multimeter in voltage mode is tens of megohms. <S> If you're measuring current, it will depend on the meter. <S> Is it fused? <S> If so, the fuse should protect the meter. <S> The "critical point" for a resistor is solely based on its temperature. <S> If it gets too hot, the internal structure breaks down and the part dies. <S> If you have some sort of current-limited DC source, set it to 5mA or so and use it directly to test for the zener effect in your unlabelled diodes. <S> Otherwise, use the highest resistor you can find to keep the current to a minimum (recognize that the zener voltage varies with load current) and test away, reducing gradually once you get an idea of the approximate voltage. <S> Keep the total power in the zener below a few hundred milliwatts for safety's sake (if you don't know what power they can handle). <A> I've seen a 1/4-watt 1K resistor explode when one end got connected inadvertently to line voltage while the other end was connected to a ground-referenced circuit. <S> Interestingly, all the current that went through the resistor also went through an ADC input on a Microchip PIC <S> (16C73 if I recall) <S> but the processor chip suffered no apparent damage.
Blowing a resistor while measuring its voltage will likely only damage the probes.
Resistors with ends of the same colour I know the values of resistors if they are gold-colored at the end. When both ends are the same, such as brown-o-p-brown and red-x-y-z-red, I am in problems. How to know which side has the last colour and which side is the starting end? <Q> I asked a similar question a long time ago here but the resistor chart which was mentioned there appears to have moved. <S> So from its new home at itll.colorado.edu <S> here's the diagram, <S> as far as I can tell one band will be thicker signifying it as the tolerance band (no-one responded when I queried whether this was the case in the previous post above so if I'm wrong please let me know). <A> The tolerance band is usually at the other end, on its own. <A> If the start and end bands are ambiguous, you can usually work out which is probably the right way to read them by seeing which way round gives you a valid E24/E48/E96 etc. <S> value. <S> .. <S> and there's always 'use a multimeter' to fall back on when you're still not sure. <A> I am lazy with bad eye sight, I use my multimeter with some crocodile clips. <S> Then it goes in a baggie marked with the value. <A> Amos provided the correct answer the time. <S> Since technology has evolved, I have found easier method: iPad. <S> I use apps such as iCircuit , eTools lite and Ohm Work to find information fast for this kind of details. <A> In theory there is supposed to be a larger gap between the value bands and the tolerance band. <S> In practice small components and sloppy printing often make this gap very hard to distinguish. <S> Some of the colors can also be tricky to tell apart. <S> You can try reading it both ways, and see which of them makes more sense. <S> For example brown-orange-violet--brown would be 130M 1% which is a standard value (though a very high one) while brown-violet-orange--brown would be 17K 1% which is not. <S> My general conclusion though is that trying to read color codes given no prior information is an excercise in frustration.
The starting point should be the band that is closest to one of the ends. When it is hard to say what the end is: use multimeter as instructed by mctylr.
Converting 24VAC to 5VDC - Need transformer demystification I've got an automatic litterbox that 'needs' to be hacked for better control. As it ships, it comes with a 120VAC to 24VAC (300 mA) wall wart that drives the two motors in it. I'm trying not to change out the original power supply, as I don't want to change the motors. What I'm looking to do is get 5VDC for a microcontroller. My first thought was to simply toss a rectifier circuit and a 7805 and I'd be done. However, it seems that the 7805 wants a max Vin of 20VDC. Next thought was to find a small transformer to step the 24VAC down to around 12VAC and then pass that to the rectifier and 7805. To that end, I started looking around for a transformer that I could use. Sensibly enough, everything I can find seems designed for a 120VAC primary. I came across this small tranformer , which I'm guessing is an audio transformer. Am I right in presuming that the resistance of each coil is directly proportional to the number of windings? Thus, if I were feed 24VAC into that transformer with a primary of 115 Ohms and a secondary of 69 Ohms, I think I would get 14.4VAC out. Is that correct? Also, can I get away with using what is probably an audio transformer for this purpose? <Q> You can't rely on using resistance measurements to get turn ratios, because they almost always use different gauge wire for the two windings. <S> The primary winding is usually several hundred turns of some fine gauge stuff, while the secondary is a few dozen turns of something heavier, to carry the necessary current. <A> If you want to get from 24VAC to 12VAC you need a transformer with a turn ratio of 2:1. <S> Since the input of a power transformer is normally line voltage (120V in your case) <S> such a transformer would be rated for an output of half the line voltage (60V). <A> If you turn 24V AC into a half or full wave, you will end up with 27V to 33V.7805 will only go up to 20Vdc AND event it <S> you make it work at 20V <S> it will get very hot. <S> You can turn to an adjustable one like a LM350 for example, you will need a few resistors more, but those have a higher input. <S> I still suggest you put a heat sink . <S> but they are not made for high current tranfer. <S> Ratio is directly proportional from the input impedence to the output. <S> Depending how it was made. <S> if you load the secondary too much, it will probably plunge down on the voltage side. <S> usual way is to use a switching regulator. <S> Look up Digikey. <S> Today there are a multitude of very easy to use switching that uses off the shelf inductors. <S> They come in all type of inputs and outputs and produces zero heat. <A> you may well end up with close to 20V or less DC after recifiying the 24V AC anyway depending on what rectifier design you use. <S> Even failing that there are tons of regulators that will tolerate input voltages higher than 20VDC <S> and i would recommend you look at switching regulators. <S> Using a linear regulator to produce a 15V DC drop is going to generate a ton of heat, you'd need a decent heatsink on the regulator. <A> I ran across this switcher in my RSS feeds this morning: LMZ14201H: <S> 1A SIMPLE SWITCHER® <S> Power Module with 42V Maximum Input <S> It looks pretty simple, just a handful of discretes. <S> It should dissipate quite a bit less power than a 7805, since it's a switching regulator. <A> I'm going to recommend the easy solution, as JustJeff pointed out -- grab a second wall-wart that gives you an appropriate voltage to feed the 7805 regulator. <S> If you insist on getting your low-current 5 VDC power from 24 VAC, probably the best way to do it is to add a bridge rectifier followed by a switching regulator. <S> Would the 3-transistor Black regulator ; or some 2-transistor Black regulator work for you?
Probably the easiest solution is to get a 2nd wall-wart that supplies a few hundred mA of regulated 5V, and you're done. However, if you really want to DIY it, you may be able to find transformers with 24V secondaries that are center-tapped, in which case you may be able to use one leg to the c.t. to get 12V AC for your diode-and-7805 approach. Using an audio transformer might make the voltage drop.
What is "foldback short circuit protection" in a power supply? I am looking at buying a 24V power supply. Two of the options are these: PSP24-060S 24 VDC 2.5A (60W) power supply PSB24-060-P 24 VDC 2.5A (60W) power supply The first offers "foldback short circuit protection" and "overvoltage protection," but it is $85 dollars. The second is much cheaper but does not mention these. What are these types of protection, and how important are they? Are they worth an extra ~$50? Thanks! <Q> A graph will illustrate the difference between classical current limiting and foldback. <S> During normal operation of the PSU you move along the horizontal part of the graph: the voltage remains constant at variable current. <S> Once the current exceeds the maximum allowed the voltage drops but the current remains (left graph), which may cause damage to the circuit, and also causes a high dissipation in the PSU itself. <S> With foldback current limiting, when the maximum current is exceeded the voltage still drops, <S> but the current is decreased to a safe value. <S> (right graph) <S> (note: \$I_{SC}\$ means short-circuit current) <S> edit <S> (overvoltage protection) <S> Overvoltage protection means that the device suppresses spikes on the input voltage, so they can't disturb the output. <S> This is often done by a VDR (Voltage Dependent Resistor, aka Varistor). <S> The VDR is placed parallel to the input and will conduct if the input voltage exceeds normal values. <A> overvoltage protection: protects the input from exceeding the specifications, <S> this would 'attempt' to protect the device from a voltage surge on the DIN rail. <S> There may also be some protection on the output. <S> With normal (high side) <S> current limiting there is a hard current cap that the supply is limited to to protect it. <S> As the load resistance approaches 0 <S> the current is limited to a fixed value and the voltage begins to drop. <S> This can cause a large amount of power dissipation in the supply. <S> With foldback protection, as the voltage drops the current limit also drops fairly linearly. <S> This provides safer protection from short circuits as a "really bad" short <S> will result in very little current draw so the supply won't be sitting there baking at max current. <S> overvoltage is what it is, <S> the response time and current carrying capabilities of basic overvoltage circuits aren't going to save you from lightning strikes but may protect you from small screwy surges from the power company. <S> A dedicated surge/power smoothing device at the source of the DIN power is a better option. <S> foldback style over current protection is simply better/safer than only having high side current limiting. <S> In both cases they are reliability/durability features, the question of if its worth it, depends on how critical downtime is for the equipment your connecting to it. <A> In general, overvoltage protection refers to output protection. <S> The main reason for overvoltage protection is to protect against someone doing something screwy with remote sensing lines (like shorting them) or the voltage feedback loop going open-loop, both of which will generally cause the output voltage to rise above its desired setting and potentially damage downstream devices. <A> Devices may be designed with one or more of the following types of overload protection: <S> When overheated sufficiently, have something melt in such a way as to kill power before things catch on fire. <S> When overheated sufficiently, have something shut down before things are damaged. <S> When overloaded, cut back on power output sufficiently to prevent the supply from overheating. <S> When overloaded, cut back on power output sufficiently to prevent either the supply or the load from overheating. <S> Different supplies will do different things when trying to drive a load which behaves as a voltage clamp. <S> Some supplies will limit the output current, independent of voltage. <S> Some will limit the output power (so a load which clamps at 3 volts will receive twice the current of one that clamps at 6). <S> Some will decide something is wrong and shut off completely (until input power is removed and reapplied) or partially (until even the reduced output current will suffice to allow the output voltage to reach its target). <S> It's probably worthwhile to get a supply which won't itself be damaged by an output overload condition. <S> Depending upon what you're driving, it may or may not be good to have a supply that will attempt to protect the load as well. <S> Indeed, in some circumstances, unexpected loss of power can be catastrophic. <S> A power supply that shuts down from a transient overcurrent condition may in so doing turn <S> what would otherwise have been a relative non-event into a disaster.
foldback short circuit protection: is a method used in power supplies to protect them from over current situations such as shorting out the output with a wire or attaching too much equipment to the power supply.
Maximum current and voltage of Small Ceramic Capacitors? Small ceramic caps are nasty because their markings, such as ceramic monolithic leaded "104M"(yellow-brownish) and epoxy ceramic monolithic leaded "223", do not reveal max values. Since I do not know their manufacturers, I cannot google for their max voltages or max currents. What is a typical maximum I for the smallcap? What is a typical maximum V for the smallcap? <Q> and they are usually 16V although i know some with smaller voltage ratings are available. <S> A simple subjective measure is size. <S> For a given capacitance and type of construction (ceramic in this case) <S> the smaller the package the lower the voltage rating. <S> Of course the only way to be sure is to try it. <S> As for current. <S> Ceramic capacitors are rarely, if ever, specified with a maximum current. <S> If the current flowing through the cap is large enough to matter your problem will most likely be the impact of the series resistance of the cap on your circuit or it generating enough heat to push the cap outside its thermal limits. <S> If you need assorted capacitors for your lab i'd look at the cap kits on digikey, there are a bunch of them and they usually come in little "fishing box" like containers that keep them all sorted for you. <S> You also gain the advantage of knowing who made the caps and get actual specs which isn't true of the assortment packs at places like radioshack. <S> You could also get one of those slide bin storage things from a hardware store and make your own capacitor assortment. <A> I hope someone corrects me if I am wrong, but just for the parts store I help keep stocked at my school we have very similar devices with maximum of 5, 15, and 50V. <S> There is no way to know, but you will probably be fine under 5V. Sorry, but I do not believe there is a simple answer. <A> All of my personal small caps in Futurlec's value packs are well-labelled between 50V-onwards, btw very price-worthy sets for beginners. <S> The lowest is 1pF with 50V max. <S> My scbool has unlabelled small caps.
ceramic through-hole caps are usually rather high in voltage rating, i don't think i've seen one in person under 25V except maybe those with high capacitance, >=1uF This rule also means that if you can find a comparable part on digikey to what you have in hand, the voltage rating is probably the same, there aren't too many manufacturers tricks left in the bag when it comes to through-hole ceramics. My teacher said that you can safely test the caps until 5V and even higher because, according to him, ceramic caps do not explode rather burn slowly. This is actually completely based on manufacturer.
Switching relay with a PNP and TTL levels I can not wrap my head around the fact how I can drive a relay (24V, 160ohm) with an tip32a PNP transistor which has TTL inputs from a controller.I can easily calculate my resistors when I use the NPN variant (tip31a), but I cannot conceive how to switch the transistor off with just TTL.The relay will be powered from 29.4V and has a resistor in series to give the appropriate 24V for the relay. And of course there is a diode over the relay. Any tips will be greatly appreciated, but please note that I at the moment can not use any transistor but the tip32a. <Q> If you have an open-collector or open-drain type logic output, you can drive a PNP with it, as long as the device is rated to take your supply voltage. <S> In this configuration, use a pull-up resistor from the supply to the base of the PNP to ensure that the PNP defaults to the OFF state. <S> Now tie the base of the PNP to the open-collector logic output through a second resistor, the value of which should pull just enough current from the base of the PNP to drive it to saturation. <S> The values aren't too hard to work out. <S> The pull-up usually wants to be something large-ish, like 50K or 100K. <S> The logic resistor will see the supply voltage, less the saturation E-B drop of the PNP, less the Vce sat of the logic output. <S> Basically, the supply voltage minus about a volt. <S> From there, knowing the necessary base current to the PNP will let you work out the exact value. <S> (Be sure that to saturate, the necessary PNP base current isn't actually greater than the current-sink capacity of the logic pin!) <S> A typical TTL output, driving the base of a small NPN through about 1K to 2.2K will give you the sort of open collector (the collector of the NPN) that I've assumed above. <A> You can't switch the PNP on and off with TTL levels. <S> Since the emitter will be tied to 29V the base needs to be at 29V to turn it off. <S> You need to do a level shift usinga second transistor which is either an NPN or an N-channel MOSFET. <S> Using an NPN transistor the current limiting resistor will then be determined by <S> \$R = \dfrac{(29.4 <S> - V_{be1} - V_{ce2})}{I_{b1}}\$ <S> where \$V_{be1}\$ and \$I_{b1}\$ are for the PNP transistor and \$V_{ce2}\$ is for the NPN transistor. <A> Why don't you use an NPN as TIP31/TIP122 transistors? <S> It will be very simple. <S> If you can't use NPN, use the TIP32 on common emitter, and on the base, put an small-signal NPN, as a 2n2222 on common emitter with a resistor (R1) on the 29V (VCC), put these block together with a resistor (R2), then calculate R2 to the same way you do the calculation on NPN (Saturation condition). <S> Then go to Rbase of the NPN, make sure it will be on the saturation condition, to the I2 current flowing into it. <S> The R1 value it's not so important as the above, so use it to achieve a faster switching condition, as the load is slower, put a value that the power is about 1/5 of the max. <S> IC(NPN), it will work good with this case. <S> If you have any doubts, make an spice simulation to see if it works or not, if the transistors are on saturation and these things... <S> Good work for you! <A> 29.4V is only 2% from 30V, and most power supplies have tolerances up to 5%, so that 29.4V might as well be 30.9V. <S> JustJeff 's solution is based on a TTL output with open collector, which sounds like a good idea to cope with the high voltage. <S> If you read the datasheet, however, it shows the 30V output as Absolute Maximum Ratings (AMR). <S> AMR is for exceptional conditions, you're not supposed to operate continuously at those values. <S> So you can't use an open collector output directly. <S> The alternative is a common push-pull output driving an NPN transistor, which in turn drives the TIP32A. Despite being a Darlington <S> the TIP32A has an extraordinarily low \$H_{FE}\$: 50 at 1A. <S> So, supposing you need 1A the base current has to be at least 20mA. <S> That's the NPN's collector current. <S> A BC847C has an \$H_{FE}\$ of 400 minimum, so that will need 50\$\mu\$A base current. <S> That's OK, TTL can source far less than it can sink, but the 50\$\mu\$A is less than the 400\$\mu\$A it can deliver. <S> Let's pick a base resistor of 22k\$\Omega\$, that will give a base current of 195\$\mu\$A. A 1000\$\Omega\$ resistor between the NPN's collector and the TIP32A's base will allow about 28mA, enough to get the 1A, and a current the NPN also can deliver with the given base current. <S> In this setup you usually add a pullup resistor between the TIP32A's base and emitter, so that the NPN's leakage current won't switch it on. <S> But the TIP32A has resistors built-in, and the NPN's low leakage current of <5\$\mu\$A will only drop 40mV, far too little to switch it on. <S> If you want 3A from the TIP32A it needs <S> at least 100mA base current <S> and you'll need a Darlington for the NPN as well, like the BCV47 .
If you do not have an OC/OD output, you can buffer a regular output signal with a small NPN transistor, like a 2n2222 or 2n3904 etc.
What if I overload a cheap AC adaptor? I'm experimenting with PIC microcontrollers and various related circuits both on plugboards and simple homemade PCBS. I'd like to use various old AC power adaptors I have lying around to power my circuits instead of relying on batteries all the time. I have several old mobile phone chargers for example that give out 5v with 500-1000mA of available power. ( I realise they are likely unregulated and I'd need a regulator circuit or similar). My worry is that that they are very cheaply made so what happens if I accidentally short circuit one or try to draw 1000mA from a 500mA supply. Are they likely protected against such abuse in any way even if only by an internal fuse? Or are they likely to be severely damaged or worse overheat and catch fire or something? Or will they simply deliver their maximum current and continue working? None of this is likely to happen, but I want to be safe? I doubt this affects the answer but this is the UK with a 240v mains supply. <Q> You could try using a resettable fuse. <S> http://en.wikipedia.org/wiki/Resettable_fuse <S> http://www.rapidonline.com/SearchResults.aspx?kw=resettable+fuse&cat=5245 <A> Wall warts are constructed as disposable commodity items, and they're usually 'potted', which means that the case is entirely filled with a solidified epoxy or epoxy-like substance. <S> I think they just count on a fine-gauge wire burning up somewhere in that block of stuff. <S> There's no oxygen available, and as soon as the fault goes open circuit, the show's over. <S> Anyway, I've never seen one of these recover, though they can sometimes provide a bit more current than they're marked for. <S> (..and more often than not, put out more voltage than they're marked for as well) <A> Most of the newer ones have switchers in them, with a stabilised output. <S> They are short-circuit protected and almost indestructible. <S> 5V ones are available from most suppliers, and are very useful. <A> The transformers are probably made to open circuit internally when they overheat. <S> It's probably required by UL regulations, etc. <S> When we do overheat tests on big power amps, the transformers will go open circuit and then you have to let them cool for an hour or more <S> and they'll self-reset. <S> I don't know what the actual component is since it's presumably buried inside the coils of wire. <S> Cheap wall wart transformers probably don't self-reset, but they are "likely" to at least have some form of internal protection so they don't start on fire. <A> Here in the Netherlands you can get used adapters for very cheap in charity shops. <S> From telephone chargers (3V) to printer adapters (18V). <S> Just clean them up and if they work you're good to go. <S> Overloaded adapters can stink a lot. <A> Almost all wall-wart type power supplies have a non-resettable thermal fuse built into the transformer these days. <S> Overloading them for a short period of time will not do any damage (the voltage output will drop, though). <S> It shouldn't be dangerous, though. <S> Note - <S> Some chinese dc-dc bricks are so cheap that they don't even have modicum of protection, though. <S> If they are 60hz transformer-based, you should be fine. <S> (And that's not even mentioning the issues with fraudulently-rated power supplies coming out of china) <A> I think endolith and JustJeff are right for most adapters. <S> However I have seen that some drop in voltage when you rise the current to much, they seem to have a fix energy that they can deliver. <S> Don't how those where designed thou. <S> If you find one of those it will not overheat and burn, but you design will not get the specified voltage and may malfunction.
Significant overloading for a period of time will cause the adapter to fail open-circuit, in a manner that is effectively unrepairable.
OpAmps - Single Supply or Dual? I'm trying to pick an op-amp and I'm having trouble figuring out if the op-amp needs a positive and a negative power supply or if I can connect it to ground and the positive supply. What do I need to look for in the datasheet? Also, where do I find the "drop-out" of the output compared to the rail voltage? <Q> Most if not all op-amps can be used in either configuration. <S> Voltage is relative, and "ground" is just an arbitrary potential that you assign the value of 0 volts. <S> This op-amp , for instance, is "optimized for single supply operation", and they emphasize features like: <S> Input <S> Voltage Range Extends to Ground Output Swings to Ground while SinkingCurrent but "Specifications at ±15V are also provided." <S> Op-amps meant for single-supply often have rail-to-rail outputs, which will usually be featured on the front page of the datasheet. <S> All op amps have two power pins. <S> In most cases, they are labeled VCC+ and VCC-, but sometimes they are labeled VCC and GND. <S> This is an attempt on the part of the data sheet author to categorize the part as a split-supply or single-supply part. <S> However, it does not mean that the op amp has to be operated that way — it may or may not be able to operate from different voltage rails. <S> Consult the data sheet for the op amp, especially the absolute maximum ratings and voltage-swing specifications, before operating at anything other than the recommended power-supply voltage(s). <S> A Single Supply Op Amp Circuit Collection <A> depending on the design of the op amp the drop out of the op amp won't be constant. <S> For example just because the drop is 1.5V with <S> +/- <S> 15V supplies doesn't mean it will be 1.5V with 0/5V supplies. <S> The LF347 you mentioned for instance does not have a constant drop out across input voltage options. <S> Theres a graph in the datasheet showing this. <S> The actual output swing will vary with a few things: output current (which can also be presented as output voltage swing vs load resistance) <S> temperature input voltage <S> (this can usually be tied into the output current) frequency and gain <S> You have to consider all these in determining your maximum output swing and these numbers are usually defined in the graphs in the datasheet. <S> When you look for an op amp for a specific purpose you can get away with generic op amps <S> but you will find better performance in parts designed for the task at hand. <S> The op amp designers usually attempt to mitigate some the variations i've listed above for particular applications. <S> For instance usually rail to rail op amps can drive the output to the rails when the output is open circuit but you will still find they will not drive all the way to the rails when driving a real load and could be substantially under the rails if a large amount of current relative to their rating is sourced/sunk. <S> Additionally rail to rail op amps usually have low drive capabilities. <A> First, what you call "drop-out" can be found on page 3 of the datasheet as output voltage swing . <S> At \$\pm\$ 15V power supply the output voltage swing for the LF347 <S> is minimum \$\pm\$ 12V. <S> Voltage is not absolute, but rather relative to some reference point. <S> If \$V_+\$ is 30V higher than \$V_-\$ for the opamp this might be a dual, \$\pm\$ 15V supply as well as a single +30V supply. <S> It works exactly the same. <S> It's you who decides where the reference, ground, lies. <S> Single supply opamps are often used with low supply voltages, like +5V. <S> You'll have to keep output voltage swing in mind; if the output doesn't come closer than 2V from the rails a 5V opamp's output will be limited to +2V to +3V. <S> Therefore low-voltage opamps are often RRIO , for Rail-to-Rail I/O. Outputs will go to a few tens of mV from the rails, and input signals close to the rails will be handled correctly as well. <S> Non-RRIO will accept any input voltage as long as it's between the rails, but voltages close to the rails won't be amplified correctly.
There are op-amps "optimized" for one configuration or the other, but they can be used in either. To find the "drop-out", look for a graph like "Maximum Output Voltage Swing vs Load Resistance" in this datasheet .
Bit/data stream unknown. How to figure out? I have taken apart a digital weight scale and on the circuit are two pins labelled 'test'. When connecting this to the soundcard of my PC I can see it is a digital signal (high/lows), but I don't know how to read/interoperate it. Anybody knows how to do this? I'm pretty sure I once saw a free/open-source program that was able to read different kind of data protocols. Anybody know it? Here is a recording when pressing up/down on the scale, perhaps it helps: http://lars.stonerocket.co.uk/images/electronics/weegschaal.wav Thanks <Q> You could try, xoscope , sigrok , SUMP or gtkwave . <A> Looking at it with audacity (thanks, Mark!) <S> you can see that there are definite bit cells of about 3.5msec each. <S> The basic waveform looks like serial data at that rate, but you can see these little spikes superimposed on the basic waveform, which are probably clock signals. <S> This would be what you'd expect if one of the lines is a clock and the other is data, and you measured across them. <S> You could try doing what Mark suggested - find a ground point on the circuit and connect that to the sound card ground, and then feed one signal to the left channel and one to the right. <S> But it's easy enough to separate the clock from the data visually in the sound editor. <S> That being said, it doesn't look like there's a whole lot of data there. <S> There are basically two sequences, these being a simple ..10101010.., and a slightly more complicated one that looks like '01101001' repeated over and over. <S> But these are just the raw bits. <S> It could be something like an NRZ scheme, where '01' means 0 and '10' means 1. <S> Or the other way round. <S> But no matter how you slice it, there just doesn't seem to be much complexity in there. <A> Just shooting in the dark but a two pin interface for something like a scale is probably a serial signal. <S> My first try would be 9600 baud with 3.3v levels. <S> If that did not work then I would try different baud rates. <A>
If it is any kind of standard protocol, it sounds like you might be able to hook up a Bus Pirate to it and try different protocols.
Transfer files from mass storage device to other machine via wifi How can one build a device that presents itself as a mass storage device to a machine via usb, then whatever files are transfered to it, get sent to a remote location via wifi (can be ad hoc). Something like the eye-fi but that can send any files. Something similar to these devices : http://www.infinitec.com/ (Why can't use : Will be released first of july which is too late for me ) http://www.hsti.com/ (Why can't use : Remote file system is mounted read only) Thank you <Q> Write a script that uses the rsync command to synchronize the contents of the SD card with your remote server over an SSH connection. <S> Set the cron daemon to execute the rsync script once per minute (or maybe less frequently, depending on the speed of the connection). <S> You would have to generate an SSH key pair and put the public key on the remote server so that the board could login without a person having to type in a password. <S> For hardware, I'd try something like one of the following: <S> Hawkboard <S> Beagleboard TS-7552 <A> If you're looking to just "get the job done", I'd go with Linux as suggested. <S> It'll work and be fast. <S> If you're trying to build something with a low bill of materials, you could consider a microcontroller talking USB mass storage, connected to some non-wifi radio. <S> Then, bridge the radio to ethernet/wifi at the other end. <S> Won't be anywhere near as fast as wifi though. <S> One approach could be a couple of jeenodes . <S> One running V-USB to talk mass-storage, the other hooked to ethernet . <A> If I may make a twist on @Joby's answer, I think you might be able to use a WiShield on an Arduino to get you the wireless aspect. <S> Then I bet there's someone who's made a MassStorage Shield (if not, that might be a good idea for me to try and pull off someday...)
You could buy an embedded Linux board with an SD card, a usb port, and a wifi card.
What should I learn? My New term is going to start a couple of weeks from now. And as it goes in colleges here the first few months of the semester are easy. I have lots and lots of spare time to learn something new. I like to learn things by myself. But have not done much since a couple of months due to submissions and finals. I would like to dive into something exciting to learn this new semester. My main interests are into uControllers, intelligence, analog electronics and robotic locomotion. Can you please recommend something which would take a few months to learn and would add to my engineering skills? Regards. Edit My really lazy question has provided the community with a nice list of things to do once you have some knowledge under your belt. The problem is not with starting things, but continuing them. I faced that problem and also many before or after me. I propose we continue adding to this list. Here is a small summary of what I gathered. Start with BEAM robotics: It has been a very facinating branch of robotics which uses only descreet electronic elements and it also has possiblity of adding intelligence using Nv Nets. But the problem is its still in its research phases and there are not many resources. I had to use the web archive to get to some papers and I dont think thats a very good sign. Making your own PCBs: This is different and you wont get to learn this in class. So if you have to access to cheap PCB manufacturer I propose this to you. Learn C: C is one of the oldest and most widespread languages and still used in industry Learn ARM <Q> Learn to program seriously in C. Nothing will benefit you more broadly as an electrical/computer engineer. <A> I'd try to learn things that you won't learn in classes. <S> For me, the biggest target is how to lay out your own PCB with a microcontroller on it. <S> It's not particularly hard to do, but it's intimidating if you haven't done it before. <S> Once you've made a few boards, it's easy. <S> You can start with the free version of Eagle for PCB layout; use batchpcb.com for ultra-cheap (and ultra-slow) <S> PCB manufacture. <S> Maybe an Arduino shield with a cool peripheral on it? <S> Then you could learn to program the Arduino to control it. <A> Get your Amateur (HAM) Radio License :-). <S> http://www.arrl.org/ . <S> As a EE who just graduated, I got a 90% on the practice test without any studying. <S> It should be relatively simple to take the test if you have the background, or the drive. <A> I vote for BEAM Robotics! <S> This kind of thing. <A> "The problem is not with starting things, but continuing them. <S> " I recognise that in some of my students. <S> My advice is to find some end goal that motivates you . <S> Just some hints: entering a robot competition (and win!) <S> setting up a StackExchange type of website for breeding stick insects writing an compiler for creating some electronic/embedded product and actually sell it on your website protecting your dorm room with the best anti-burglar system ever created <S> Some 15 years ago I wanted build a laer tag system, and I wanted to introduce the kids of the local electronics club to PIc programming. <S> So I created a PIC programming langauge and compiler <S> (Jal) creaded a PIc programmer (Wisp, now Wisp648) <S> started selling PIC chips because the local electronics store was way too expensive <S> One or two of the elctronics kiddies indeed programmed a few PIc chips, but I never got around to build the laser tag system. <S> That's just to show that once you have a goal there is plenty to do!
I'd recommend picking something small, on the scale of an Arduino or a Lilypad, and try making a board.
Converting/scaling a voltage range ([0v - 5v] to [-5v - +5v]) Can anyone explain how one would convert one voltage range to another? I'm going to need to convert a range of 0 to +5 volts into a range of -5 to +5 volts. How would this be accomplished? Thanks! <Q> For working with power conversions rather than signal - You can use various integrated circuits for this job, they're commonly referred to as Dc to DC converters , there's also a range of ways to do the conversion such as Charge pumps . <S> Here's a bunch of different DC to DC converters <S> they have various different current ratings, some step the voltage up, some step down and others convert between positive and negative values. <S> This is a nice charge pump IC that can double or invert a voltage with the minimum of external components. <S> You could even use a 555 timer to convert a voltage to a negative Hope this helps. <A> I want to try using this ascii system, lets see how it does. <S> This is a circuit that does what you want. <S> -5V <S> | .-. <S> | | <S> | |2 <S> K 2K_ '-' .----|___|----. <S> | | <S> | <S> | | <S> | ' <S> --------o <S> | <S> | <S> +Pwr <S> | <S> ___ <S> | |\| <S> |input-|___|---------o----|-\ <S> | 1K <S> | <S> > <S> -----o----Output <S> .----|+/ <S> | <S> |/| <S> GND -Pwr(created by AACircuit <S> v1.28.6 beta 04/19/05 <S> www.tech-chat.de) <S> So, it takes the input, doubles it and subtracts 5 V. <S> This will make 2.5V become 0V, 0V becomes -5V, and 5V stays 5V. <S> It does it linearly over the range, this can be valuable if it is a signal that needs to be spread over a new range. <S> Hope this helped. <A> +5V <S> | .-. <S> | | <S> | |2 <S> K 2K_ '-' .----|___|----. <S> | | <S> | <S> | | <S> | ' <S> --------o <S> | <S> | <S> +Pwr | | |\| <S> | <S> .----|-\ <S> | | <S> >-----o----Outputinput--------------------|+/ <S> |/| <S> -Pwr(created by AACircuit <S> v1.28.6 beta 04/19/05 <S> www.tech-chat.de) <S> This will make 2.5V become 0V, 0V becomes -5V, and 5V stays 5V. <S> The circuit posted by Kortuk will invert the input resulting in a mapping from [0v -> 5v] to [+5v -> -5v] <S> instead of [0v -> 5v] <S> to [-5v <S> -> +5v]. <S> Here is a simulation .
There are many ways to do this, the easiest I think would be a summing op-amp configuration.
Which relay - Mechanical or Solidstate? Anyone familiar with relays mechanical or otherwise? I would like to be able to switch on/off up to 250W (120V) load using a microcontroller. Will be used to control lighting to an aquarium. <Q> Solid-state relays are easier to use than electro-mechanical ones. <S> They can be controlled directly by MCU outputs and you don't have to worry about things like putting diodes across coils. <S> I've used lots of them with an ARM to control motors and valves in a complex piece of medical equipment. <A> Solid state is the way to go. <A> You can see a list of advantages and disadvantages here: <S> http://en.wikipedia.org/wiki/Solid_state_relay#Advantages_over_mechanical_relays <S> In your case, whatever. <S> Both solutions work. <S> It will depend on the variable that you take into account, such as price, life cycle, etc.
Mechanical relays require gobs of current to keep the coil energized, much more than you can directly get from a microcontroller, and when you want to switch them off, you have to contend with all the flyback energy too (i.e., the diode thing).
Recommend any ADC ICs? I am looking for an ADC IC and while I could just take the plunge and pick one, I was wondering if anyone had any experience with any particular devices? I need it to: Connect to an AVR via I2C/SPI (I2C preferred) Have at least 8 bit resolution (10+ would be nice) Have at least 3 inputs Currently I am looking at the ADS7830 . Any recommendations would be fantastic. <Q> Use the built-in ADC on the AVR microcontroller. <S> Even if you have to choose an AVR with a slightly higher pin count and slightly higher cost, the total system cost and PCB size will likely be smaller. <S> Reduced parts count typically results in higher reliability as well. <S> There are several AVR choices with 10 and 12 bit <S> A/D converters. <S> See the Parametric Product Table for more info. <A> <A> I know this sounds crazy, but for 8 or 10 bit resolution, a stand-alone ADC costs more than a chip that includes both a CPU and a ADC.(For the reasons Kortuk mentioned, 14 or more bits of precision are usually handled by an external dedicated ADC.) <S> The Atmel ATtiny13 is <S> the lowest cost chip I know of with an ADC -- less than the MCP3208 or MCP3204 at my favorite distributor.(I think you can program it to emulate a has 3 input 10 bit SPI ADC). <S> The Atmel ATtiny261 is the lowest cost per-analog-input chip <S> I know of <S> (it has 11 input 10 bit ADC). <S> If your analog sensor is far from your CPU, it makes sense to put an ADC right on the analog sensor and pipe noise-resistant digital samples back to the CPU. <S> Perhaps that "ADC" should be a second CPU emulating a slave SPI ADC.(On the other hand, sometimes it's better to use a hard-wired chip that "just works" -- like the Microchip MCP3208 -- than to spend a bunch of time programming and debugging a microcontroller).
The Microchip MCP3208 (SPI) is very easy to use.
What are some reasons to connect capacitors in series? Usually you either combine capacitors in parallel because you want to increase the total capacitance while fitting the components in a certain shape/position, or you just combine capacitors by buying a single capacitor of a larger value. Combining capacitors in series reduces the total capacitance, and isn't very common, but what are some possible uses for it? It shouldn't be used to increase the voltage rating, for instance, since you can't guarantee that the middle will be at half the DC voltage of the total, without using bleeder resistors. <Q> In an automotive application I've seen two ceramic capacitors in series to increase safety against shorts. <S> In the extreme case a short could start a fire, and I heard that had happened at least once. <A> Another reason when done in production designs is to reduce your bill of materials (BOM). <S> If your design has loads of 100 nF caps but needs one <S> ~50 nF, it is often cheaper to use two 100 <S> nF's in series due to the quantity you're buying the 100 nF's in, and also reduces pick/place setup time. <A> I have only seen it done to increase voltage. <S> On some power supply front-ends (AC/DC conversion) with a voltage doubler the capacitors are in parallel at low voltageand in series at high voltage. <S> This works out well since for a constant power outthe current is double at the lower voltage. <S> As you mention balancing resistors are required. <A> Kortuk's comments here are the first time I've heard that putting two identical electrolytic capacitors back-to-back is "very risky". <S> The following references seem to contradict Kortuk: <S> "electrolytic capacitors ... <S> Non-polar (or bi-polar) devices can be made by using two anodes instead of an anode and a cathode, or one could connect the positives or negatives of two identical device together, then the other two terminals would form a non-polar device." <S> -- <S> http://electrochem.cwru.edu/encycl/art-c04-electr-cap.htm <S> "you can substitute two regular electrolytics in series ... with their negative ends joined in the middle. ... <S> in fact, that's what you'd find if you opened a real nonpolarized capacitor." <S> -- Charles Platt. <S> "MAKE: <S> Electronics: Learning Through Discovery". <S> O'Reilly Media, Inc., 2009. <S> p. 249. <S> (excerpts available on http://books.google.com/ ). <S> "A common argument is over whether or not you can make a non-polarized capacitor by putting two polarized electrolytics back-to-back. <S> People have been doing this for years, with no problems to my knowledge." <S> http://my.execpc.com/~endlr/electrolytic.html <S> Of course, the capacitor will blow up (or not) <S> no matter which way the majority votes. <S> Sometimes the underdog is right. <A> You sometimes see electrolytics connected in series, with opposite polarization directions. <S> In other words, one cap will always be forward biased, no matter what the externally applied voltage. <S> This is, I believe, how one arrives at the situation of having a 'non-polarized electrolytic' capacitor. <S> follow up - turns out that what might LOOK like two ordinary electrolytics are not, in fact, two ordinary electrolytics. <S> Despite the uncanny resemblance to exactly that, it is highly probable that the devices I saw had other properties as well. <S> So the moral of the story is, if you see what looks like two electrolytics stuck together back to back, it is high probability an 'NP' electrolytic, but don't try to make one on your own with regular electrolytics. <S> (Kind of like "you can't make a BJT from two diodes") <S> live and learn <S> , right? <S> that's why we all love our stackexchanges. <S> thanks out to Kortuk for the eye opener. <A> I have only ever done it to increase voltage rating, and we were using large super-capacitors. <S> They were rated to 2.7 V and we wanted 5V, so we connected in series. <S> We purchased a nice charging controller, which did the job of ensuring they both had the same charge, charging them in parallel. <S> It decreased our Capacitance to ~25 <S> Farads I believe, but the ESR was <.1 ohms. <A> I've used ten 3.3F supercaps rated at 2.7V in series to build a buffer capacitor for a digitally controlled locomotive of a garden model railroad. <S> This makes it run much better over dirty tracks or switches. <S> The nominal voltage is 24V. <S> For the first version I used a schematic proposed by somebody else, which doesn't balance voltage. <S> There is a 3k3 resistor anyway to discharge it over some minutes, to prevent surprises. <S> The second one will use a 1% 330 resistor per capacitor to balance voltage, we'll see if there is a difference in longevity. <A> =) <S> Connecting them in series increases the voltage capability (add voltage limits of all caps in series). <A> If capacitor shorts, it can burnt PCB trace or worst it may cause fire. <A> Well, maybe people rarely see this configuration; however, this trick could be used to create high-voltage bipolar capacitors. <S> If you series-connect two equal value capacitors in series, cathode-to-cathode and use only the positive lead of each cap to connect to other part of the circuits. <S> This trick are very often seen in audio equipments. <S> My two cents.
To have robustness against short circuit specially ceramic capacitors that are connected to power lines. To make a railgun
Car Tail light - why the extra components? I'm replacing the LED in a car tail-light. Naturally, it will run off 12V (battery) but the circuit I have uses just an LED and a 0.6w (440ohm) resistor. But the existing circuit includes two, larger resistors (the power ratings, that is, I assume are higher) and a diode. Can anyone tell me what functions these play in the circuit? Is the diode for protecting from reverse current, as I'd assume? (not for voltage drop or anything like that), if so, why would there be a risk of this? And why are the resistors so much larger, when the LED I put in should easily run from a 0.6 resistor? Would the existing LED be a higher wattage LED; It's just the same looking led, there's no heat-sink or anything. <Q> It is likely a zener to keep the LED at a constant brightness. <S> Car power is not constant, it's only loosely regulated, and since the LED has a very fast response time changes in vehicle voltage (say when you start your airconditioning) may be percieved as flashing your light. <S> Filament light bulbs take awhile (100-300mS) to visibly react to a change in voltage, so it's not an issue for them. <A> The diode is likely a zener diode to short out voltage spikes generated inadvertently by the alternator. <A> However, I will point out that you want to use 13.8V <S> (The voltage output by the alternator) for your calculations, not 12V. Small difference, but it's always good to remember. <S> In this circuit, it means you can''t put in a 13V zener, or you'll find yourself sinking the alternator voltage for a short amount of time, and then your zener will release its magic smoke. <A> A point about LED's - most led have a very low reverse breakdown voltage, so a standard led may fail if connected the wrong way round on about 12 volts <S> (Yes I know - car batteries are 13.8 approx, but can be anything from 10 to 16 V, with a lot of 'noise' on the supply) <S> So to protect the LED from being put in the wrong way round use a standard diode... <S> (They are just across the socket to 'waste' power) <S> Some cars will display a warning that a bulb is blown. <S> To prevent this you must take about the current a bulb should take... if your Led's just took 20ma (0.02A) at 14v (0.28W) <S> and the original bulb was 5W - around 357ma (0.357A) - a circuit that expected .36A <S> seeing .02 would trigger an error...
The high watt resistors are there to 'disable' the blown bulb detection circuit in some cars... I don't have an answer to your question about the extra components without a schematic, although I'd agree with Pingswept's guess - Remember that your LED doesn't need a reverse current protector; it is a diode itself.
How to propose/work on a project for work They keep me fairly busy at work, and I've got a number of cool projects. We don't have a Google 20% time to work on our own ideas, and we have process improvement engineers and R&D engineers who spend their entire careers working on and thinking up new ideas. I'm not a process engineer, an R&D engineer, or a senior engineer with the freedom to choose or invent my own projects, but I've come up with some projects that I'd like to explore. How should I pursue this? I don't want to appear arrogant to my superiors, I don't want to tell R&D what they should be working on, and I definitely can't just put off my assigned projects to work on what I want to work on. I would like to get payment and/or attribution for the ideas, but that's not as important as seeing it happen. I'd also like new ideas to happen with the support groups that we already have (I don't want to do someone else's job.) As far as I can tell, my options are: Submit the project to my superiors/R&D. Make time in my schedule or work more hours to do the project at work. Work on the project at home. None of these seem to be ideal. I can submit the project to someone higher on the decision chain, but my ideas generally aren't necessary to the business or safe bets, like the ones that they are constantly receiving. I discuss many of them with my boss, and he generally thinks they're good ideas. Sometimes I have a solution for a pie-in-the-sky feature request that gets put off as too hard. I just don't want to go to the gurus and say "Look, why didn't you try this? You should spend the next couple weeks implementing it." I'm just an hourly intern. Working ahead isn't really an option because they keep a list of projects in my queue. When I get one done, I'm supposed to move onto the next highest priority, and I really can't just ignore that for my ideas. Working on it at home is possible, but then I lack the support chain that the rest of the group provides, have lesser tools, and might get into some issues with not being able to take stuff home. Additionally, I don't get paid for it this way, and this method also guarantees that it will take more time than if it was implemented at work. Has anyone else had similar struggles? I'm sure that most every engineer has ideas, and I'd like to hear about what you did to submit them to your company. Edit: We have about 5,000 employees at my company . However, I work in the testing department with about 15 other people; it really doesn't feel very big. I personally know most of the people who have developed the projects that I want to work on. Edit2: I've proposed my ideas to my boss, and he's been interested. I'd rather not just submit them to R&D, as the devices and systems I want to work on would be familiar to myself and my department, but new to the R&D guys. <Q> I think the fact that you're an hourly intern puts you in a tough spot. <S> While I find your spirit and initiative admirable, and probably a sign of a good engineer in development, I think you're unlikely to find a solution where you will get paid to work on those ideas. <S> Getting paid to work on, as you say, "pie-in-the-sky" ideas is one of the hardest qualities to find in a job. <S> I think it's easier to find jobs that are high-paying, easy, or both. <S> The best strategies I can think of are to impress your boss or inject your ideas into the R&D team. <S> Perhaps you could swing a deal with your boss along the lines of "If I can get this project done well by Monday instead of Tuesday, can I spend Monday working on this new idea? <S> You pay the same amount either way, and this idea is really awesome."? <S> Good luck. <A> Have you described your projects to the boss? <S> Instead of worrying about process too much, just ask him to give you a couple days to work on it. <S> You are a low-paid intern, so use this to your advantage. <S> If you waste a couple of days on a project, the company hasn't wasted a senior engineer's salary on the idea. <S> But be pretty sure you can get the project done on time before suggesting it, because your success will lead to further opportunities. <S> It's OK to be enthusiastic as an intern. <S> That's really what you were hired for, not experience or knowledge. <A> Does your company host student projects? <S> I'm thinking about master thesis and such. <S> If yes, you could ask to be a mentor for a student project in your company and supervise students implementing your ideas. <S> I suppose you could set some of your working time as supervision. <S> Of course, I have no clue if your ideas could apply to student projects...
You need a trusting boss, an impressive track record of successful implementation of previous work, and a company in a dynamic field.
How do I measure a negative voltage with a ADC? I am working with a PIC micro-controller with inbuilt 10bit ADC and want to measure a voltage in the range of -1 to -3Volts. I thought of using an op-amp in the inverting mode to make voltage positive and then feed it to the adc of the microcontroller however here I would have to power the opamp with a negative power supply, right?. I don't want to use a negative power supply at the moment and was wondering whether it was possible to achieve this configuration? Can you'll help out? <Q> An inverting amplifier does not need a negative rail to invert the voltage. <S> Try to think of your power rails as what supply your output. <S> If you look at the circuit, all op-amp pins are tied to a voltage of 0V or higher. <S> When your range of -1 to -3 comes in, it will show up as the exact opposite of 1 to 3 on the output. <S> This also gives you some advantages as a buffer, as the input impedance of your pin will not affect this circuit very much (so long as R in ||R f is large). <S> I agree that a simple resistor divider does the job -- just letting you know that this also works. <A> Say you have one with equal resistors and a 5V power supply, this will result in a voltage between +2V and +1V for your -1 to -3V range. <S> +5V + | R | <S> +-- OUT | R |IN -+ <A> The voltage divider idea is nice, cheap, but gives you the problem of a change of the voltage to be measured will be seen as 1/2 the change at the ADC input. <S> If accurate measurements are of interest, the solution is a zener diode as the bottom half of the divider. <S> If the thing being measured can tolerate losing a teeny bit of current, this will work great. <S> Zeners aren't absolutely flat in their reverse breakdown voltage, especially for very small currents, so don't make R1 too big. <S> Now to see if this stackexchange site allows me to add images... <A> This is the standard circuit for that sort of conversion. <S> I simulated it to prove to someone that it worked, hence the SPICE schematic. <S> You need to choose appropriate resistor values, it works as long as they are 2R, 2R and R. <A> I'm at (non-electronics) work right now, w/o handy electronics sw or books, so this will be just a rough idea. <S> Maybe someone else can fill in the details... <S> Try a current mirror using a pair of PNP transistors hanging on the Vcc rail. <S> Feed the negative voltage signal to the input side of the mirror through an appropriate resistor. <S> The same current should then flow through the output transistor of the mirror. <S> With a well-chosen resistor you create a voltage range within 0V to Vcc. <S> EDIT - NEW: <S> Here is the current mirror schematic. <S> Whatever current passes through transistor T1, T2 will try to make the same current flow. <S> The negative voltage to be measured, relative to the power supply which I randomly chose to be 15v, creates some trickle of current through R1 (measured in simulation as "inputcurrent"). <S> If R2 were the same as R1, you'd find the same voltage across it, if it were allowed to. <S> But it's connect to 0V (gnd) <S> - our circuit is based purely on a positive supply. <S> It won't work unless we make R2 smaller, say 1/2 of R1 <S> then the voltage across it will be 1/2 of whatever's across R1. <S> Measure <S> it, do math (whoo, multiply by 2, hard!) <S> and there you are. <S> The schematic has different values, a different ratio , but I think we all can handle the math for this. <S> The advantage of this over a simple voltage divider is that 1) it looks more complicated, 2) <S> it's a common trick in analog IC design. <S> Since I wrote another answer using a Zener diode, I'm not sure now why this is better, but it is an alternative to a voltage divider and may allow getting at different ranges of voltages or something. <S> Now I let others comment on the wisdom or foolishness of this idea... <A> You might not even need an op-amp. <S> Some ADC's (like the MCP3304, see datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21697e.pdf <S> have a built in differential mode, where the ADC returns the difference of two channels, which can be a negative number. <S> If you tie one channel to ground (called pseudo-differential mode), the ADC can accept a negative input voltage on the other, and translate it into a negative number, all without needing a negative voltage. <S> Of course, this only applies if your ADC supports this sort of thing. <S> Many don't have differential mode at all.
You could use a voltage divider, with one end hanging off the positive supply rail.
Looking for open source FPGA hardware and dev tools Investigated FPGA boards but cannot find open-sourced board and vendor-neutral FPGA development tools: The ORSoC manufacturer boasts open-sourcing on its website but I cannot really find strong evidence except webmastering OpenCores.org. The duo: Xilinx advertises its products with "Open Source Hardware Innovation Contest for Mainland China Universities". Still their products are proprietary, poor support for *ix --. Similarly, Altera has a poor support for *ix, just check their OS support with Quartus or how to have your logic analyser in the synthetic step? Group of small players -- let you point the best. Is there some manufacturer strong with open-sourcing things such as hw and dev tools? <Q> Sadly, there isn't much free software for programmable hardware. <S> There are a few synthesis tools, such as Lava (which expects largely manual placing), Confluence, HDCaml and Atom , and Icarus Verilog , but next to no fitter, mapper or place and route tools (I would absolutely love to be proven wrong in this). <S> Opencircuitdesign.com has collected some tools, but it probably requires some documentation and a bitstream generator. <S> Simulation, on the other hand, is fairly well covered. <S> On the non-free side, Xilinx' non-free but gratis tools have seen some improvement recently, by adding libusb support and dropping Wind/U (a horrible non-free winelib analog) in favor of Qt (but they won't be updating for retired chips). <S> Most other tools seem sabotaged using a package called flexlm, to such a degree that it's hard to get them running even with the aid of the vendor. <S> I have also been able to run Lattice Diamond software under Linux, but that lacked simulation. <S> For Atmel AT40KAL, the place and route tool could be run in Wine, but the library demands non-standard components (it uses LPM, but refuses 2-input gates), so a sort of mapper would be needed. <A> The Butterfly Board looks like a good open source beginners route into FPGAs. <S> They've already ported the AVR8 core so you can run Arduino sketches/AVR object code on the thing, so there's a sane learning curve. <S> Update: Now renamed to Papilio Boards . <S> I think that Xilinx WebPack is needed and it's available for Windows and Linux. <A> Unfortunately the synthesis tools are all closed source as far as I know. <S> The code contained in them is a big part of their business advantage, so I feel it is unlikely you will seem them open sourced. <S> Xilinx does have free toolchains for Windows and Linux, and if you don't like their IDE <S> you are free to use their commandline tools with your own editor. <S> I've done this before, it works well for small projects (eg CPLD) where you don't want to fool around with big complex software packages. <S> Altera <S> I believe only offers free tools for Windows, their Linux tools are paid only last time I checked (this may have changed, it's been maybe a year or so since I last looked). <A> FPGA development tools are all tightly coupled with the FPGA devices themselves and are utterly dependent on proprietary details of the FPGA architecture, particularly at the placement, routing, and bitstream generation levels. <S> As such, vendor-neutrality is largely non-existent. <S> Higher-level tools may be vendor-neutral to some degree (e.g., Synplify, ESL tools, verification tools, etc.), but they're certainly not open source. <S> As long as you don't want to develop for a real physical device, you can use the VPR 5.0 toolchain. <A> Neither open-source nor still supported but Xilinx offers a free, cross-platform (Java) API called Jbits which allows directly programming (and on-the-fly reprogramming) of FPGAs. <S> I believe only CPLDs and up to Virtex-II are supported, but it's the closest thing to allowing devs to produce their own custom synthesis tools. <S> Planning to play around with this quite a bit in the near future.
On the other hand, there are many academic tools that are open source.
Boundary scan developer and testing tools I have to choose a tool for production testing of fairly dense PCB's with 4+ FPGAs 10+ DSPs, ethernet controllers and PCI controllers.. Does anyone have any experience with any of the tools available from GOEPEL, XJTAG, Jtag-technologies or if anyone know of any good open source alternatives? That is both the BS hardware controller and/or software.. <Q> OpenOCD is an open source JTAG debugger, it supports a good range of adapters both open source and proprietary. <S> It's worth looking into. <S> But, I have only used it for simple boards with single microcontrollers. <A> I work for GOEPEL in the UK, we offer a free trial as well. <S> We normally accompany this with a board setup, so you can get a better feel for what the tools can do. <S> Whereabouts are you based, I can get our local office to get in touch or just register on our website. <S> No real open source alternatives, what you are paying for is automated test generation. <S> The low cost end of the market can normally get you in toggling pins, programming files etc, but if you are looking at production test you need safe quality tests that are going to find your build defects. <S> Depending on your test coverage, you need to consider if Boundary scan alone will cover this or does it need other test strategies or functional test. <S> Be careful on how test coverage is reported, if you start hearing 90-100% quoted then dig deeper into the figures. <S> If it is not too late, check out our design guidelines. <A> I can recommend the GOEPEL tools for their extensive set of features and capabilities. <S> Test development is highly automated yet allows me to set constraints easily. <S> The software also comes with great JTAG debug tools. <S> Once you know what you want to do with the tools they can configure a software and hardware configuration that is very price competitive and provides an upgrade path that allows you to add capabilities in the future, if you need to. <A> If you want to exercise processor / DSP interfaces at speed for advanced debugging, I have used the following tools successfully as they can operate in background debug mode, depending on the specific tool: Asset Intertech Corelis <S> JTAG Technologies <S> All of the tools (amongst others, no doubt) can be used for both initial commissioning and debug as well as production test, so they are multi-purpose. <S> All of them support in-system programming and can also support JTAG gateways <A> I did some benchmarks of three tools (Goepel, Corelis, XJTAG) about 3 years ago with a custom board (FPGA, OMAP, various small ICs). <S> We found that the XJTAG tools were by far superior to the Goepel or Corelis tools in terms of usability. <S> I can also highly recommend their support. <S> All three vendors were happy to provide the tools for this benchmark. <S> I recommend doing the benchmark with your own board. <S> It will be harder but you will see real-world problems and how they are handled. <A> You also can try JTAG Technologies, Corelis or FLYNN onTAP <S> tools. <S> I'm working with all of these and the JT looks the best today. <S> But all up to you and to prices. <S> Please read about JTAG Manager tools.
I like the new tools from JTAG technologies as they have analogue ports available on some controllers which comes in very handy when the board has DACs and ADCs.
Learning videos for electronic concepts? Are there any interesting and graphical videos for learning electronic concepts, like basic principles of capacitor, inductor, resistor, transistor and other advanced concepts like digital electronics? I am mostly looking for animated videos which would teach me concepts and possibly their practical applications. I have been reading books but haven't made much progress. <Q> I really like this interactive circuit simulator. <S> http://www.falstad.com/circuit/e-index.html <A> Not quite what you're looking for, but after you get beyond the introductions that Joby pointed out and on to the practical applications part, you'll want to get comfortable with a simulator so you can try out your own designs and change some of the numbers around. <S> Most of the web videos don't let you play with the circuits more than flipping switches, and breadboarding all your circuits takes a long time. <S> Linear Technology's LTspice is an introductory SPICE simulation environment :( for Windows only) which has an easy learning curve and includes a huge number of switching regulator demo circuits (which are one of many applications for caps, inductors, and transistors). <S> There's a simple video introduction here , an active support group here , and the manual is here . <A> These are for the most part higher level then what you are asking for. <S> Some are about changing education, some are about engineering design, and some are about optics related concepts. <S> Now, none of these may interest you, but he does one of the better explanations of a Fourier transform . <S> Fourier links to the first, transform links to the second part, in case you have a hard time finding it. <S> This professor is big on trying to make engineering education more available to students, and feels with good teaching almost anyone can learn the basics of very complicated subjects, as you see he does some basic maxwell's equations(very basic) and teaching many concepts related to his lasers class. <S> Students build a working laser with a gain medium and mirror by the end of it.
There is a professor I know whom has put many videos on youtube to teach about a range of concepts .
What is a good choice for an ARM to interface with external memory? I just completed a project using the LPC2132 chip, but ran into problems with using up the whole 64kb of RAM. For my next project, I'd like to use something that can reference an external, much larger memory chip. What sort of ARM can do this and what do I need to do to get the two devices talking? <Q> You don't need an MMU for external RAM memory, the determining factor if you need one is a completely separate issue from simply needing more space. <S> If you've been coding directly to the metal it may actually make your life easier not having an MMU. <S> I'd also like to note that an MMU is virtually never an external component but rather on the SoC die. <S> the NXP LPC2212 <S> Series not saying <S> its the best, just the first ARM7 SoC <S> that came up in google with an external memory interface, there are lots of options. <S> I'd pay more attention to the features of the various cores in the ARM families as you can find almost all of them in SoC's with external memory controllers. <S> Now as to what type of memory you need and how to get it working, that depends on the SoC you choose and what memory the external memory controller supports. <S> For instance the ARM7 SoC i linked supports external SRAM as well as flash's and roms and supports up to 4 16MB banks, so you could hook external flash and SRAM to it at the same time. <S> You could use separate RAM and flash IC's there are also packages called MCP (Multi Chip Package) that can include both flash and ram in 1 package. <S> How you choose these devices depends on many factors, you'd need to be more specific about your application. <S> How easy this is to hook up <S> depends on the speed you need. <S> Most external memory controller have programmable clock rates. <S> The memory interface clock rates could be very high at least 10MHz and likely much higher. <S> In short your very likely not breadboarding something like this, you need to design a PCB and pay special attention to signal integrity issues for these lines. <S> Your best bet is to pick a core you want to play with and a find one of the many development boards out there with external memory on it. <A> With this you is able to connect Flash, RAM, and other memory peripherals like LCD and such. <S> I can recommend the STM32F103ZET6 as tcrosley also said, and you can get a development board including flash and sram on ebay for $68 - http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=220619908411 <A> I recently had a similar requirement for a new project, and chose the STMicro STM32F103ZET6 <S> (ARM 32-bit Cortex-M3), with 512K of internal Flash and 64K of internal RAM for around $10 in quantity. <S> It has a memory controller which can address up to 64MB of external memory (26 address bits). <S> Available in a 144-pin LQFP package. <S> (I don't like using BGA for prototypes.) <S> I will be interfacing it with a 2MB Cypress SRAM, without any other glue required (no multiplexing). <A> Maybe an Atmel AT91SAM9G20 ? <S> It's a bit of a beast (217-pin BGA package), but it's a great chip for the price. <S> If you're looking for something a little more human-friendly, maybe try the Atmel AT91M42800A . <S> I think that's the smallest MCU that has external memory hardware, at least from Atmel. <S> It's a 144-pin LQFP package. <S> Atmel has a parametric selector: http://www.atmel.com/dyn/products/param_table_v2.asp?family_id=605&OrderBy=part_no&Direction=ASC <S> (I guess I should add that I don't work for Atmel; I just happen to be familiar with their stuff.)
The larger series of STM32 processors (32-bit Cortex-M3 core) has a FSMC, which is a Flexible Static Memory Controller. You can find ARM SoCs in many families that allow external memory from the ARM7 on up for example
How to switch something else on with an arduino How would I press the electrical switch on say an electronic paintball or airsoft gun? Let's say it is just a SPST switch. <Q> To press a switch, you'll need some kind of expensive solenoid or servo , and mechanical linkages, and mounting hardware, and trigger pressure characterizations, and power-loss state characterization, and a 12V power supply, and driver circuitry, and it all adds up to a lot of work to push the physical trigger. <S> If I were you, though, and had access to the hardware, I'd characterize the circuit the trigger switch is attached to (is it normally open or normally closed <S> is really all you need to know), and attach a simple relay or MOSFET to an I/O pin on a microcontroller (I'd suggest the relay, because it's closer to the original circuit, avoids any voltage referencing issues, and has a mechanical spring to ensure that if your circuit goes dead, the trigger won't go off). <S> Then, remove the switch from the gun, and attach your circuit. <A> I would go with the relay personally, quick and easy. <S> Arduino to close the relay <S> , NO connected to the switch. <S> Easy as. <S> Digital pin to run the relay. <S> Just make sure your relay can take the current from the switch it's replacing, which should be low anyway, and that the 5v from the arduino is enough to active the relay. <A> Here's a bit of a tutorial on relays and Arduino: http://tronixstuff.wordpress.com/2010/04/20/getting-started-with-arduino-chapter-three/
Sustained fire will work just keep the relay energised.
What's the cheapest way to link a few microcontrollers wirelessly at low speeds over short distances What's the cheapest way to link a few microcontrollers wirelessly at low speeds over short distances. I'm looking to keep it ultra-cheap, use common discrete parts and keep it physically small. I don't care about bands and licensing so long as it works. 802.15.4/ZigBee, Bluetooth and WiFi all require an expensive coprocessor, so aren't an option. Alternatively, are there very cheap radio modules available to hobbyists? The kind of things you find in car keyfobs and wireless thermometers, perhaps? Would building a simple transceiver on a homebrew PCB even be practical, or will I be plagued by tuning, interference and weirdy analogue stuff? Could something like this be driven from a microcontroller?What about receive? <Q> You pretty much have to buy pre-made modules, you can't expect to wire up your own transmitter/receiver from a few transistors and a crystal, RF circuit design is unforgiving and all but requires a custom PCB (or custom IC) to do. <S> You could probably build your own RF module on a PCB if you did some work, but at that point if you are making your own PCB's, you're not saving much money versus the very cheap modules that are available. <S> SparkFun has RF Transmitters & Receivers for $4 and $5 respectively. <S> Since they are just basic parts, you will need to do a little extra logic on your microcontroller to compensate for interference, eg sending error control codes so that missing / flipped bits can be detected and recovered. <S> I found SeeeeeedStudio sells almost the exact same thing, but even cheaper. <S> It's $4.90 for a pair of a receiver and transmitter . <A> However, interference with other devices like remote controls might be a problem. <S> If the connection needs to be really reliable, this probably wouldn't be that great of an option. <S> However, you might be able to find a really uncommon wavelength emitter and receiver to limit the amount of interference. <S> These are pretty common, and very cheap. <S> Packs of 20 emitters for $1 and packs of 100 receivers for $13 can be found on eBay (not including shipping). <S> Lots of electronics stores have them as well. <A> The cheapest radio modules I know are the RFM12 modules, they do frequency shift keying in the 433 or 868 MHz band. <A> <A> You might take a look at the Jeenodes . <S> They are simple and relatively cheap and provide a nice layer on top of basic RF modules for doing serial transmission and point-multi-point communication. <A> I'm not sure if this would count as cheap enough, but the Linx chips are dead simple. <S> I've made a PCB for these chips and successfully run 16 sets at the same time in a 10 x 20 m room without any special PCB trickery. <S> Future Electronics has the TRM-315-LT modules for £11.33 each in the UK. <S> There might be other modules that are cheaper, but I think those are the ones I used previously (it was ~6 years ago, <S> so my memory is a little fuzzy). <A> The RFM70 (warning: I sell them) modules are even cheaper than the RFM12. <S> The documentation is equally bad but I made a good C library which should make using them a lot easier. <S> You can find the library here: VOTI RFM70 libraries <A> The Nordic nRF24 series. <S> If you order non-amplified versions of these modules, they can be had for under $7 per module. <S> Amplified versions are in the range of $15-$20, so range is a major factor in price. <S> The ones Sparkfun sells are about $23, but are amplified. <S> Unamplified modules have been reported to get around 30 ft of range with trace antennas. <S> These modules also have the benefit of error detection, acknowledgement and automatic re-transmission. <A> I second the RFM12 and JeeNode suggestions and strongly discourage you from rolling your own using a simple on/off transmitter. <S> It is not so easy to make the transmitter/receiver work without RF experience and even if they work then digital modulation and demodulation of a noisy signal are still not trivial. <A> It's 2018, and prices have come down signficantly. <S> It's now possible to buy WiFi modules like the ESP8266 for $2.82 to $2.26 each from reputable dealers , or for $1.37 from unknown sources .
The Nordic Semi nRF24L01+ is easy to use, SFE sells modules. Infrared emitters and receivers can be used to transmit/receive data.
What configuration should I use for a system that includes an ARM and an FPGA? I have a design that uses an Altera Cyclone FPGA to implement a Physically Unclonable Function (PUF) and an ARM device to do cryptographic work and I/O with the PUF. The PUF is very large, and takes quite a bit of space (only about 1/4th will fit on the Cyclone) My question is, would I be best served by getting a large enough FPGA to include both the PUF and the ARM core or a smaller FPGA for the PUF and a second, external ARM chip? Can you provide some suggestions? If I used two chips, they would communicate with SPI. There is not a lot of communication between the two, nor does it need to be fast. <Q> I can't comment on your specific application (not being a cryptography expert), however placing a processor on board with a FPGA is an exceedingly common thing to do. <S> Mostly the reason is that you now free up FPGA space to do what FPGA is good at, while using the less expensive separate processor to do what it is good at, perhaps even faster than could be done with a soft CPU running in the FPGA. <S> In addition, larger FPGA's can get quite expensive, compared to faster ARM's which can be fairly reasonably priced. <S> Basically I think you should use the two chips, but it's hard to make a proclamation for sure without knowing details about your specific area. <A> I think the right answer of two chips vs. big FPGA will boil down to what sort of attacks the device will face. <S> That means you need to know something about your possible attack scenarios and security needs. <S> What's the harm if the attacker does probe that SPI communication? <S> Does he get keys? <S> Plaintext? <S> Intermediate stages of the encryption process? <S> If the attacker can parlay that probe into plaintext, what's the harm? <S> Illegal access to a pay satellite tv channel? <S> Financial data? <S> Military secrets? <S> This is the most important thing to understand. <S> It informs all of your other questions (because of course the more sensitive the data, the more it's worth protecting it). <S> Will the device be somewhere that the attacker can mess with it without detection? <S> For instance, if it's a security system in a blu-ray player, you have to assume that the attacker is going to open the thing up while it's running at some point. <S> On the other hand, if it's a Military communications system used only by the President of the United States, it might be safe to assume that the attacker isn't going to get any alone time with the device. <S> How motivated is the attacker? <S> What sort of resources is the attacker likely to have? <S> Are you allowed to seal the thing into a special box that can destroy the board if breached? <S> You need a good profile of what you are up against in order to make this decision. <A> depends on the size/complexity of the ARM core and the FPGA you need. <S> The only technical concerns are power usage (the single large FPGA is likely higher) and data integrity on the SPI line. <S> That is, can your system's security be compromised by someone scoping the data being sent on the SPI line. <S> Other than that, price is the issue. <S> Don't forget to include PCB space and required external components for each IC when consider the price differences. <A> However, security concerns would either required encrypted communications on the bus, careful measures to make sure no important data goes over the bus, or using a single monolithic chip. <S> There are other issues, too. <S> FPGA's are usually programmed from Flash memory (except in some rare cases that use things like anti-fuses). <S> You also have to worry about the application being eavesdropped on during configuration. <S> Even after configuration, many FPGA's and other microcontrollers also have JTAG pins that can be used to read the program back out of the device, or inspect other aspects of the programming!
From a practical design standpoint, the separate chips are a good idea.
What is the best way to heat sink a chip when soldering it on? I generally like to solder sockets to my boards, rather than the chip directly, but am now forced to solder the chips directly. I have several DIP and SMD components that this needs to be done with. I am concerned that the heat from soldering them might damage the chips so was wondering how I could heat sink them? Is this even necessary? It doesn't apply to me right now, but how is this done with other packages? <Q> I have used these tips to get started with SMD soldering. <S> Until now I have not found it necessary to drain heat as long as you mind where you put the soldering iron tip and don't apply heat any longer than needed. <S> http://www.infidigm.net/articles/solder/ <S> - The second article is better, see comments PS: This article may help as well, it seems to be quite good: http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=36&page=1 <A> Your worries are unjustified. <S> The graph shows a typical temperature profile for reflow soldering. <S> Note that all of the IC is subjected to temperatures close to and above 200 <S> °C for minutes . <S> Not one pin, all of them, and the IC's body as well. <S> No pin-by-pin soldering can apply that much heat to the package. <A> You can buy a tool that is a heatsink designed for temporary use while soldering. <S> They look like clumsy pliers. <S> That will work well for the DIP components. <S> For SMD components, you might try putting something cold with large thermal mass and high thermal conductivity (say a chunk of aluminum foil you put in the freezer for a while). <S> I've held stuff like that in place with a rubber band around the PCB, and it makes some difference. <A> For surface mount chips, a reflow profile is usually also included in the datasheet. <S> These profiles show a time versus temperature graph to use when soldering using ovens. <S> Even if you aren't using an oven, it is still good to look at for an idea of how much temperature for how long should be applied. <A> I solder up tons of SMD boards by hand, and I have to say that I don't think I've ever seen a chip damaged by solder heat. <S> This may have been a problem back in the old days, but new chips are made to survive lead-free reflow soldering temperatures. <S> But here's a good tip. <S> Hold your finger on the chip while you solder it. <S> Firstly, this helps to drain heat from it. <S> Secondly, if it gets too hot for your finger, stop soldering for a bit. <S> Hugo
Most datasheets will list what the max soldering temperature is for the chip, you should look these up and make sure you don't exceed them.
DC Motor control with an Arduino This might be a simple, silly question, but I am wondering why I can't just connect a DC motor to an arduino board to have it running. One pin to the ground and the other to one of the PWM outputs. I just did the sweep tutorial for a servo motor http://arduino.cc/en/Tutorial/Sweep and it works fine. I know that a servo has more electronics in there with pot providing feedback. From what I understand to drive even a small DC motor I would need more circuitry (an H bridge?) or another shield dedicated to driving motors. I can understand this if I was driving some relatively big DC motors. But I am trying to understand why a small DC motor with a ground and PWM input would not work. Especially for a brushed a motor like this one http://music.columbia.edu/~douglas/classes/motor_mania/DC_simple2.jpg Surely its just a matter of DC current passing through the wire. Is it the inductive charge building up in the coils that can cause reverse current back to the board thats the problem. Basically, from a conceptual point, given I have a ground and a voltage (albiet a pulsed one), what do I need to do it to make it drive a DC motor. <Q> <A> In addition to what everyone else said, you need protection circuitry to ensure that inductive kickback from the motor doesn't destroy the pins on your Arduino, which will happen eventually if it's not protected. <A> As was stated earlier the Arduino PWM pin can not supply <S> /sink the amount of current required to run even a small DC motor. <S> The best way to do it would be to use an H-Bridge between the Arduino and the motor. <S> A less expensive alternative would be to use a power MOSFET that is capable of supplying the current required by your motor. <S> Microchip has an application note that describes these methods of motor control. <A> Do you need by-directional control of your DC motor? <S> If that's the case, I would highly recommend the following circuit (even though you will use up one PWM pin for each direction, you will get more than enough current amplification from your power source that the Arduino cannot provide): alt text http://imagebin.ca/img/CKdfPB6n.png
It's because of the amount of current you need to drive the motor, the arduino can't supply much.
Methods to test/debug I2C protocols? I've been working on some digital designs with I2C command & control and need a PC-based tool to test my interfaces. -- In the past, I've used iPorts (MCC) to do these tasks but the price tag of approx $500 each has always seemed steep. What are some other available (hopefully cheaper / more robust) tools to help with this task? <Q> To me, robust means: throwaway price, comes with schematics and software <S> and I could build or fix it at home. <S> Here are two favourites, both around the $20 mark, exposing USB serial and PC scriptable: <S> The Bus Pirate is a universal bus interface that talks to most chips from a PC serial terminal. <S> Lots of serial protocols are supported: I2C, SPI, 1-Wire, JTAG etc. <S> as well as a bit of AVR/PIC programming and EEPROM dumping. <S> It has a low speed logic analyser and sniffers for I2C and SPI. <S> There's an active forum with good support . <S> (It's a PIC24 with a USB serial port and some bus switches for open-drain pullup trickery. <S> Windows only MPLAB needed for firmware development. <S> ds30 serial bootloader pre-installed for "field upgrade".) <S> USerial is an I2C, SPI and GPIO bridge, using an Atmel AVR. <S> It'll also run on any AT90USBxxx board , eg. <S> Teensy , Benito , Nanduino .Compiles with gcc. <S> Well documented. <A> was the real reason I chose this part. <A> If you want to send I2C commands from the PC to an I2C slave device you will need something that will act as a I2C master. <S> In the past when I've wanted to do this I wrote a simple program that converts USART to I2C. <S> Then use a PC terminal program to send data to the I2C master via RS-232. <S> You should be able to do this using a breadboard, PIC, and RS-232 transceiver. <A> The FTDI USB-MPSSE cables are promising (approx $30 each). <S> It took a lot of effort and a few emails to their customer support to get them to work though. <S> In September 2014, their published DLLs (v0.3 and v0.4) did not work for I2C communication. <S> We had to get unreleased , beta flavors of their DLLs just to achieve basic I2C read/write capabilities.
The Diolan U2C-12 is what I use Probably not the cheapest, but i've been very happy with it for I2C/SPI and GPIO work, their ready to go linux library
Communication between microcontroller and separately powered PCB On one board I have a microcontroller with one power supply and on another I have a Flip Flop with a separate power supply. I want to connect a pin of the microcontroller to the reset pin of the flip flop. Can I just put a wire accross or does it need more than that? I was going to do that but now I'm not sure that would work because it wouldn't be a complete circuit and the two boards may not have quite the same ground levels. The two boards have to have separate power supplies because the board with the DSP is premade and the power comes from the mains. Thanks <Q> A single wire may or may not work - check to see if your boards have a common-enough ground. <S> At the very least, you can probably run two wires - one to tie the two grounds together and another for the data. <S> If for some reason you can't have a common ground, you can look into optoisolators . <A> If the supplies on both the boards are isolated, e.g., batteries or most wall-warts, you just need to bridge the grounds together, which provides the return path for the signal you want to use. <S> If you're at all worried that the grounds might not be isolated, you can temporarily connect them through a 100K resistor and measure the voltage drop across the resistor. <S> If the drop across the resistor is nearly zero, then you should not have a problem connecting the two grounds. <S> The reason for the resistor is that a DVM has high enough input impedance that just measuring between the grounds might show you some voltage <S> that's more electrostatic than actually electromotive; the resistor dissipates the electrostatic aspect. <A> If on separate boards, use a differential signaling approach such as LVDS , with a driver on one board, and a receiver on the other. <S> (This assumes the two boards have ground voltages that are reasonably close together -- if not then you need an isolation barrier.) <S> Reset signals are an example of something that is sensitive to glitches -- a momentary glitch on a reset line has an effect on the future state of the chip going to it. <S> You can get away with less-careful approaches if the signals in question are stateless inputs. <A> Thinking out of the box: You could place a simple motor or a relay near controller, connect a usual thread to it and lay it to the second board, where you place a switch, connected to it's ground <S> or it's VCC. <S> (it could be a real wire -> single-wire signal transfer :D ) <S> If those two boards are in optical visibility you could put IR transmitter-receiver. <S> ... <S> something else...
You may get lucky and it will be just fine (since both boards will be connected to the mains ground, at least in some way).
Do you layout in mil or mm? I have been using 10 mil trace with 10 mil spacing. The PCB vendors quote that they like traces down to 7 mil. But then I ran across a PDF showing how to fan out a QFP to get all the signals accessible. They use millimeters because the QFPs are packaged with 0.4mm or 0.6mm pitches. They also make an argument that using a 0.05mm grid approximates mils, but mm allows you to route buses in between the vias and pads. Should I be using mil or mm when I am routing a PCB? <Q> I think the system used by the majority of your active parts is the system to choose. <S> Older parts were all 0.1 inch pitch, but at least some newer parts have ball or pin pitches specified in mm. <S> I'd default to metric because it's the world standard, but if you're manufacturing in the US, you might default to inches. <A> While the metric system is arguably saner, those that have been doing PCBs for much longer than myself have are pretty adamant about using mils. <S> I think it has something to do with the machines used by manufacturers. <S> That being said, if you have a board house in mind, and they spec their capabilities out mm, then yea you'll probably get a neater routing by picking a grid that is "natural" to your components. <S> Typically though, you're going to have a mix of parts that are mm and mil based, so you'll likely have a "grid mismatch" regardless. <A> Tom at PCB Matrix advocates using metric exclusively, as the majority of high-tech parts are metric. <S> I actually use both, in the same design sometimes, if I have a mixture of metric and Imperial parts. <S> It doesn't really matter all that much with the software I use, as it can make connections off-grid, but I get neater results. <A> Use whatever is more convenient for you. <S> It doesn't matter what units packages are defined in because any decent software decouples package definitions from layout and routing dimensions anyway. <S> Use whatever metrics the datasheet uses when defining the package footprint, since that will minimize errors. <S> Even then, I switch back to inches when defining the silkscree and documentation layers because that's what I can relate to more directly. <S> I learned this stuff thinking in inches and mils, so that's what I use. <S> I can picture 8 mils in my head, but I'd have to convert the equivalent in mm to get a mental picture. <S> That's what computers are for. <S> They are very good at multiplying or dividing by 25.4, so let them serve you, not the other way around. <S> When exporting files to a board house, I'd use inches. <S> That seems to be more of the univeral standard, probably due to history. <S> The board house's computers can multiply by 25.4 too, so those board houses that use mm internally won't be bothered. <S> A few years back, some board houses wanted all input in inches, but I suspect that's no longer true today. <A> Typically I place parts on a 25mil grid and route on a 5mil grid. <S> For low density boardsI can usually route on a 10-25mil grid. <S> When I route I have the traces snap to the mid-point of the pad so that traces endin the center of the pad for all components. <A> Brazil uses metric system but my layouts are in mils because because it is the most widely used. <A> I use mil, because that's what they use at the company I outsource the PCBs to. <A> It depends on the parts you're using and the capabilities of the fabricator. <S> If the fabricator is working with mils, then making the design on an mm grid may cause minor alignment issues. <S> These issues though, are only a problem if you're really testing their clearance specifications. <S> Even then, its unlikely to actually result in a non functioning PCB. <S> Personally, I use mils. <S> Mils also lets me think in terms of integers for things like wire width, clearance, and so on. <S> And my manufacturer deals with mils anyway. <A> I have the same opinion as Olin, since I'm used to think in metric <S> I choose mm; if I were born in the US I'd probably go for mils. <S> But I keep a conversion table for the most common sizes/distances at hand, so I don't have to make calculations every time. <S> Oddily enough, my PCB fab requires some dimensions in mm, some in mils, so I'd have to convert either way. <S> Even if not for that, you'll from time to time stumble upon values that need to be converted no matter what you choose. <S> Why not pick the choice you're most comfortable with, then?
The vast majority of my parts use mils for pin spacing specification. I pretty much always use a 25mil grid and things usually turn out "good enough." For layout and routing, use whatever you are comfortable with.
What is the purpose of "MOSFET driver" IC's There are dedicated "MOSFET driver" IC's available (ICL7667, Max622/626, TD340, IXD*404).Some also control IGBTs. What is the practical purpose of these? Is it all about maximizing the switching speed (driving gate capacitance) or are there other motives? <Q> An output pin of a microcontroller is usually adequate to drive a small-signal logic level MOSFET, like a 2N7000. <S> However, two issues occur when driving larger MOSFETs: <S> Higher gate capacitance - Digitalsignals are meant to drive smallloads (on the order of 10-100pF). <S> This is much less than the manyMOSFETs, which can be in thethousands of pF. Higher gate voltage - A 3.3V or 5Vsignal is often not enough. <S> Usually 8-12V is required to fully turn on the MOSFET. <S> Finally, many MOSFET drivers are designed explicitly for the purpose of controlling a motor with an H-bridge. <A> Yes, it's about maximizing the switching speed by dumping lots of current into the gate, so that the power MOSFET spends the least amount of time possible in the transition state, and therefore wastes less energy and doesn't get as hot. <S> It says as much in the datasheets of the parts you listed :) <S> The ICL7667 is a dual monolithic high-speed driver designed to convert TTL level signals into high current outputs ... <S> Its high speed and current output enable it to drive large capacitive loads with high slew rates and low propagation delays ... <S> The ICL7667’s high current outputs minimize power losses in the power MOSFETs by rapidly charging and discharging the gate capacitance. <A> Yes. <S> And another reason is to drive "high side" of the bridge. <S> For this those ICs have an external capacitor and internal oscillator with diode voltage multiplier, so the gate driving output is providing voltage few volts higher than bridge and/or bus voltage. <A> If you want to calculate the gate current during switching you can use this formula: <S> Ig = Q/t where Q is the gate charge in Coulomb <S> (nC from the data sheet) and t is the switching time (in ns if you use nC). <S> If you need to switch in 20 ns, a typical FET with a total gate charge of 50 nC will need 2.5A. <S> You can find nimbler parts with gate charge below 10 <S> nC. <S> I prefer to use 2 BJTs in a totem configuration for driving MOSFETs instead of the expensive driver ICs.
A MOSFET driver IC (like the ICL7667 you mentioned) translates TTL Or CMOS logical signals, to a higher voltage and higher current, with the goal of rapidly and completely switching the gate of a MOSFET.
Which equipment for electronics should I always have on hand? This is a supplementary question to the question Which electronics components should I always have on hand? <Q> Digital multimeter Soldering iron <S> Oscilloscope Power supply <S> If you've got those 4, you're in decent shape. <S> After that, I'd add a frequency generator, then a spectrum analyser. <S> If I were starting an EE lab at a company, and I was going to buy those tools, here's what I'd start with: Fluke <S> 117 multimeter ($160) <S> Weller WES51 <S> soldering iron ($88) <S> Tektronix <S> 1001B <S> scope ($880) <S> Agilent E3631A power supply ($1383) If I were a hobbyist just getting into the field, I'd limit myself to the Tools section of Sparkfun , plus the Tektronix scope. <A> Depending on what kind of components you're using, you'll probably want some kind of magnification. <S> Chip makers just don't make 'em like they used to (DIP, that is). <S> Everything is trending towards smaller. <S> Also, as part of that, you want a really really really good light source. <S> In fact, you probably want a great light source just for your bench area <S> and then a smaller LED flashlight or something to shine into all the crevices to see part labels, solder bridges, etc. <S> Sometimes you just don't want to pick your board up and move it around to get light into all the places you'll need it. <A> Hope nobody takes this the wrong way, but .. <S> how about a fire extinguisher? <S> = <S> P <A> Essential for debugging circuits, especially as I work on video a lot. <S> I picked up mine for £150 a few years back. <S> Personal laptop (my main computer.) <S> Cheap multimeter (about £20.) <S> Cheap soldering iron (backup.) <S> Solder, solder sucker and wick. <S> Breadboards <S> x 10. <S> Various stripboards and completed projects. <S> PICkit 2 + demo board, AVR programmer and Launchpad (MSP 430) board. <S> Components (all E12 resistors up to 1M ohm, various electrolytics and various ceramics.) <S> At a minimum I would recommend a multimeter, scope and power supply. <A> Having one clamped to the bench allows me to have good lighting where I need it, and having a lens for checking for solder bridges/cold joints/part numbers... <S> If you want to get pricey, go for a stereo scope which can go to about 40X. <S> These are great for SMT rework. <S> Also on the high end are the Pace soldering stations. <S> I used to have a PRC-2000 (overkill, usually) and some of its features were very handy. <S> Using solder/flux paste with a controlled dispenser, and a hot-air soldering tool (900deg F) will allow for better-than-factory SMT work with a bit of practice. <A> I've never bought a bench supply new; I have several second (and third, and worse!) <S> hand bench supplies that have done a superb job. <S> No need for fancy eight decimal point displays... <S> a couple of panel meters and an adjustable current limit are all you really need. <S> I'd throw into the mix the following Aligator clips (both the normal kind and the really tiny "grabber" variety tweezers, and reverse tweezers (they open when you squeeze them) <S> locking "scissors" (they don't cut) - great for clamping light. <S> A couple of gooseneck lamps with "150W" compact fluorescent bulbs collection of banana jacks/sockets and pushbutton and slide/toggle switches <S> I also second the magnification. <S> I splurged and found a nice binocular inspection microscope (0.8 - 3x magnification I think). <S> It was about $700 <S> but it's sure handy when trying to solder 0402 components or solder 30AWG <S> on to 0.5mm pitch devices! <S> I don't need a fancier soldering iron than my old Weller WES51 <S> if I've got a decent scope. <S> I get headaches from trying to use loupes or the (much) cheaper magnifier on a swingarm. <A> A logic analyzer if you or doing digital or certain microcontroller work. <S> Many more channels than a scope, better triggering, e.g. on patterns. <S> But you still need the scope to check signal levels, signal integrity. <A> Some items I didn't see mentioned: A nice vise. <S> I used the cheap "helping hands" from Radio Shack for years and they are OK, but then I got a little 3" Palmer bench vise cheap at an auction of a bankrupt machine shop <S> and it is perfect for holding anything from circuit boards to TO92 packages for soldering. <S> A magnifier of some sort to check for shorts, or even to read labels on SMT packages. <S> I have a 4" magnifier I paid about $5 for at Northern Tool and <S> a nice Bausch & Lomb loupe I won at the same auction. <A> I found this complete video ( How To Set Up An Electronics Lab ) that maybe can help somebody in the future.
Temperature controlled soldering iron. Cheap dial (or digital: they can be around $10 on sale these days) calipers; again for use in making/modifying enclosures. I have on my workbench and around my room: Digitising oscilloscope. Desktop computer+LCD (also a stable 12V, 5V & 3.3V power supply and a video monitor.) One thing I've found very useful is a large magnifying lens/light combo on a swing arm. Tweezers, X-Acto knife, Dremel tool with variety of bits and a nibbler for modifying cases.
Close enough for voltages? I want to extend the use of a camera. The camera currently uses a special li-ion 3.7V 1000 mAh battery. I could grab a couple of those batteries, wire them up in parallel, and that'd work just fine. But if I didn't want to use those special batteries, would there be any problem using standard batteries? For example, could I wire up three AA 1.2V 2400mAh bats in serial to end up with a 3.6V 2400 mAh battery? Now my real question: Is the voltage difference (3.6V versus 3.7V) a problem, or is it close enough? Thanks. <Q> Li-ion batteries range from about 4.3V - 3.3V as they discharge. <S> 3xNiMH batteries would range from about 4.2V - 3V as they discharge. <S> Too low of a voltage is not a problem, the camera already will have circuits to not turn on if the battery drops too low. <S> All it means is you might not get the full use out of the NiMH batteries as compared to the Li-Ion, but there wont be any harm to anything. <A> That will work just fine, but you should measure the voltage of your 1.2 V cells to be sure. <S> As they discharge, their voltage will drop. <S> I suspect that your camera has a 3.3 V low-dropout regulator; I bet you won't get into trouble until very close to 3.3 V. <S> Even if the voltage sags, I suspect that the worst that will happen is that the camera will turn off sooner than you want. <A> Lithium batteries are occasionally marked 3.6 or 3.7 volts. <S> More often 3.7 because it looks better. <S> But it's a nominal marking and, as said, the real voltage goes from 4.2 (cutoff to prevent overcharge damage) to somewhere around 3 (cutoff to prevent deep discharge damage). <S> So nickel (or alkaline) and lithium batteries will spend a lot of time in the same range, as it were. <S> There may be a difference in how the battery (and the device!) <S> behaves once the batteries are getting close to empty and how they age. <S> I suppose this is a digital camera that will write to flash memory. <S> That takes a certain voltage at some current. <S> If the battery is too weak and dips when its loaded, the write might get interrupted with undefined results. <S> But it all depends. <S> If the device and its functioning is very important (you're taking the photo of a lifetime...) <S> I wouldn't risk adding random variables like batteries it wasn't designed for.
If it's for random use and will work better for you with the new batteries, I'd absolutely go for it. It should just work, presuming you take care of charging correctly.
Survey of High-Level Language Interpreters/Compilers for Microcontrollers I would like to generate a list of high-level language interpreters and compilers (e.g. something that compiles LISP to C code) for microcontrollers. I've done a bit of research so far that I will document here: List of projects for running Python on microcontrollers: http://web.media.mit.edu/~nvawter/projects/pyMicro/ PyMite: http://wiki.python.org/moin/PyMite python-on-a-chip: http://code.google.com/p/python-on-a-chip/ Armpit Scheme: http://armpit.sourceforge.net/ TinyScheme: http://tinyscheme.sourceforge.net/home.html Minimal LISP Interpreter: http://www.sonoma.edu/users/l/luvisi/sl5.c Embedded ML: http://embeddedml.sourceforge.net/Site/Intro.html eLua: http://www.eluaproject.net/ Embedded JAVA: http://en.wikipedia.org/wiki/Embedded_Java amforth: http://amforth.sourceforge.net/ TinyTCL: http://tinytcl.sourceforge.net/ Tiny BASIC: http://www.ittybittycomputers.com/IttyBitty/TinyBasic/index.htm AVR shell: http://www.instructables.com/id/AVRSH-A-Command-Interpreter-Shell-for-ArduinoAVR/ Bitlash shell (AVR): http://bitlash.net/wiki/start Transterpreter (occam-pi on AVR): http://www.transterpreter.org/ Rite (embedded Ruby) (will be released in 2011): http://www.slideshare.net/yukihiro_matz/rubyconf-2010-keynote-by-matz Jal (pascal like) for PICs, compiler: http://www.casadeyork.com/jalv2/ libraries: http://code.google.com/p/jallib/ .NET Micro Framework (C# and VB.NET): http://netmf.codeplex.com/ This is a community wiki – please feel free to add to the list. <Q> I would add Staapl to this list. <S> Staapl allows you to use Scheme macros as a metaprogramming tool on top of a forth-like stack language. <S> Staapl currently targets the PIC18 chips. <S> Forth is definitely not a high level language, but the addition of Scheme on top of it eases the development. <A> Here is a good list from SO that lists languages targeted to micros, although I think you got most of them. <S> I've added the ones missing, leaving out the C interpreters. <S> There are also programs that will compile C++ to C, and I have seen some experimental work to translate c# to c for micro use, but that seems unnecessary. <A> Some AVR interpreters: <S> http://www.cqham.ru/tbcgroup/index_eng.htm <S> http://www.jcwolfram.de/projekte/avr/chipbasic2/main.php <S> http://www.jcwolfram.de/projekte/avr/chipbasic8/main.php <S> http://www.jcwolfram.de/projekte/avr/main.php <S> http://code.google.com/p/python-on-a-chip/ <S> http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_id=688&item_type=project <S> http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_id=626&item_type=project <S> http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_id=460&item_type=project <S> Some AVR compilers: <S> http://winavr.sourceforge.net <S> http://www.iar.com/website1/1.0.1.0/107/1/ <S> http://www.mcselec.com <S> http://www.e-lab.de/index_en.html <S> http://www.mikroe.com/eng/categories/view/21/avr-compilers <A> I would like to add C# using the .NET <S> Micro Framework. <S> There are many ARM ports in use and it is well supported and documented. <S> http://msdn.microsoft.com/en-us/library/cc533001.aspx <S> Some of the well known development boards out there: Fez Panda/DominoNetduino and Netduino plus <A> I'm in the process of installing the toolchain to use the Transterpreter with the Arduino. <S> It lets you write occam-pi for the ATmega chip (which supports concurrency). <S> The Transterpreter is now part of the KRoC (Kent occam-pi system) project.
There's also an occam-pi library that supports all of the Arduino functions: http://projects.cs.kent.ac.uk/projects/kroc/trac/wiki/CrossBuilding
Programming a parallel port as digital I/O I'm trying to use a parallel port from a computer as a form of cheap digital output to do various things (control motors, light LEDs, read limit switches, ect). I want to know how to control the 8 data pins on a parallel port using C++, however there's a catch. Since I'm using a modern computer with a modern OS, this presents a few problems. First of all, modern windows OS's don't allow direct access to parallel port pins, I must go through a driver. I have been pointed to using Inpout32 to do this, however the sample program compiled and ran properly but my attached hardware didn't respond. Another person has pointed me to using Windows API. I have searched the MSDN and found only mentions of the appropriate function but without some sample code, I'm lost (maybe I'm searching in the wrong places). The second problem is that my new computer doesn't have any parallel ports. I must use USB to parallel ports instead (cheap and direct from China, $5 each, shipping and taxes all included). The ports are recognized by the computer as IEEE-1284 controllers and the appropriate drivers were automatically installed and the computer reports the device as "working properly". From what i have seen online, there seems to be a wide variety of opinions on the usefulness of these USB to parallel port connectors. One person says it works perfectly fine like any regular parallel port soldered to the motherboard, another says it will work with some hardware hacks, one says it can write but not read, and finally another says it won't work at all because they are not designed to work the same way as "real" parallel ports. I have already done a great deal of research before coming here (sort of as a last resort I guess, StackOverflow didn't yield any answers even after applying a bounty). Pretty much all the information I found on programming parallel ports is outdated and assumes that you have either a parallel port on your motherboard, a pre-Windows-NT OS, or both. If anyone has any idea how to do this, would you please share it with me? Thanks, -Faken Note: I'm running Windows 7 x64 OS on a Core i7 860. I'm programming in C++ on Visual Studio 2008 pro. The USB to parallel port connectors are connected via USB 2.0 ports. <Q> With current technology, if you want to operate on a number of discrete <S> Old school parallel ports came in a variety of flavors, and not all could do input, since the port was primarily designed to send data to a printer. <S> There were only a couple of handshaking lines that were actually dedicated to input. <S> If you really want to use a USB parallel port, you should look for the EPP or ECP variants, as these were the bi-directional kind. <A> Parallel port is dead, and USB microcontrollers are really the future IMO. <S> If you use the HID or CDC profile you don't even need any driver on your PC. <S> Eg the Teensy for $18, you get 25 <S> I/O, of which all can be used as digital I/O, or up to 12 of them as analog inputs and 7 of them PWM channels. <S> The Teensy is more general purpose, if you want something specifically to provide communication between your PC and electronics <S> , there are other devices targeted more towards that, like the Bus Pirate . <S> Or, if you don't need too many I <S> /O's, you could use the standard, fairly simple FT232R USB chip in 'bit-bang' mode , and get 8 digitial <S> I/ <S> O out of it. <S> If you absolutely refuse to listen to reason, then what you need is a PCI card which adds a parallel port, like this one . <S> You'll need a PCI slot (not PCI-Express), most motherboards still have one these days, but they are starting to get phased out. <S> USB to Parallel adaptors will have all sorts of problems. <S> The main one is latency... <S> standard parallel port latency is measured in microseconds, whereas USB latency is measured in milliseconds. <S> The other is that many USB to Parallel adaptors are designed only for printers, and lack the extra circuitry needed to individually control the address lines in the way you want. <A> The fact that you're trying to do this on Windows further complicates the matter. <S> Direct interaction with hardware, while not impossible, is seriously complicated by the HAL. <S> I have done this under Linux using the parapin library, but that was on an older machine with a real parallel port on the motherboard. <S> Looking at the notes for pyParallel under windows , it seems to require the giveio driver, which rules out the use of a USB -> Parallel adapter. <S> I'm going to have to agree with Jeff and Joby above. <A> You might be better off with an Arduino. <S> Then, you can communicate with your PC application over the RS232 link. <S> It's not much more expensive than a USB parallel port adapter. <A> I would like to add that all of the usb to parallel port adapters I have come across do not emulate a parallel port, they emulate a printer over USB and hence cannot be used for their individual IO pins. <S> Perhaps there are some that do this the way you want but surely you would be better off with a USB IO solution with many more IOs such as an IO-Warrior or an Arduino. <A> Are you sure you hooked your device up to the parallel port correctly? <S> Did you get a pinout, hook up to the right ground, etc? <S> I would get an oscope or a DMM, then toggle all 8 data bits when you press a key on the keyboard, and try to see at least that happen. <S> Are you using the right address? <S> The default address for motherboard-soldered parallel ports (0x378, I believe) is probably not going to work. <S> You should go through Device Manager's Ports (COM and LPT) node, find your USB->parallel adapter, Resources tab, and find the base address for your adapter. <A> USB devices have no base address, they are not part of the address space of the CPU, much like a server on the internet <S> is not part of your address space. <S> And everything about USB to parallel adapters has been said in this tread already, they usually do not work for anything but printing.
I/O signals, your best bet is to tinker with a dedicated USB microcontroller, or a standard microcontroller coupled with an FTDI USB-to-232 interface. Go get an Arduino or some other microcontroller and tackle the problem that way.
What is the most popular embedded serial bus? I'm designing an embedded device that I would like to make interoperable with third party peripherals through a serial bus. Should I choose SPI, I²C, or some other bus? The peripherals will be pretty low bandwidth (some sensors that communicate over the bus, polled periodically) and most likely within a metre or less of the controller. The controller's sole task is to collect the sensor data, package it in some way, and then send it off to a wireless module via another bus (although the sensor bus could potentially be reused for this too). <Q> If you're uncertain, and your requirements are pretty vague, I'd pick I²C. <S> The major difference between SPI and I²C is that SPI requires a chip-select line for every peripheral. <S> I²C broadcasts a peripheral address at the start of communication, so it doesn't need chip-select lines. <S> Chip-select lines get cumbersome after the first few. <S> On the other hand, SPI is probably easier to implement and debug. <S> It could be the winner if you just want to connect to a couple of devices. <S> I'd rule out USB unless you need high data rates over relatively long distances (m rather than cm). <S> You might consider Dallas 1-wire, but I suspect it's not as common as I²C, and a "1-wire" bus that needs 2 wires to operate has always seemed a little fishy to me. <A> Since you said that it would be low bandwidth I would allocate enough IO to handle both SPI and I2C. I would also if possible have additional CS lines so you can run multiple SPI devices. <S> Also don't forget to look at how you are going to power the peripheral. <S> If you are running off of a battery to get max life you need to put the device in low power mode or remove power when not in use. <S> Also use you controllers serial controller module if possible a lot of controllers will mux SPI, I2C and serial. <S> If you can and split the wireless from the sensor this makes it easier to shut down devices when not in use. <S> Also some sensors have a line that will tell the controller when they need to be serviced <S> so you also want to have an extra IO going into a pin ideally one <S> you can generate an interrupt from. <A> The question is a bit of a problem because of definition issues. <S> Serialized communication is basically what you need if you want to communicate with some external peripherial without using umpteen ports on your controller. <S> Basically every serial communication method needs a clock and a configuration on how to handle data connections. <S> SPI is a 4 wire bus. <S> I2C is a 2 wire bus. <S> Each has different characteristics. <S> What you need to answer is how fast does your communication need to be, how reliable does it need to be, what options does your microcontroller offer, etc. <S> This wikipedia article and this reference site explains much more clearly than I can, also follow the references to learn even more! <A> Regardless of which bus you use, you should consider the voltage level of your sensors and third party peripherials. <S> You can do this by making your own converter with two MOSFETS (Only goes <S> one way - Pick up/no change or down/no change; only a problem if you need to run your sensors at 3.3 and interface with 1.8 and 5V masters). <S> See NXP's AN10441 <S> [PDF]. <S> This will also work for SPI (Just remove the pullups). <S> You will need to add a line to your connector to establish a reference voltage (if you're not doing so already.) <S> One downside of I2C is that you're limited to the slowest clock on the bus. <S> If one sensor is only capable of 100kHz and you want to talk to your memory at 400kHz or 1MHz (both valid speeds), your slower sensor's behavior is unspecified. <S> If you use SPI, the chip select line means that the slower sensor won't even be listening to what's on the bus, and you can run different speeds for different sensors. <A> Most communications peripherals I've seen use SPI not I2C.
Basically, you should choose between I2C and SPI. I'd also rule out RS-232 unless it's still 1976 and your peripherals need a massive signal to distinguish a bit from noise. I would use I2C. Just make sure that you can get a wireless module that can communicate over I2C if you want to have it on the same bus as your sensors.
How do I learn HDL I have a course in Digital Design in this semester and just love it. Now I know that most of the work in embedded system and digital design is done on computer simulators first and then implemented using hardwares. So I was wondering how should I go about learning HDL. I have few questions What? I don't know what are the standards but would like to learn which is simple to pick up. I understand that most of the HDLs are designed for use with FPGAs I don't what that. How? Should I follow a text book with independent examples or should I embark upon a project like implementing a small system (may be something like traffic light control). Where? Where would I get the resources? <Q> I'm almost in the same situation as you. <S> What I'm doing: <S> I'd took a free very basic course of VHDL in the college that I'd studied. <S> I'd played with Spartan 3E board . <S> So, I bought the board and I will start to play. <S> A friends of mine have suggested these books: <S> Rapid Prototyping of Digital Systems , James O. Hamblen, Michael D. Furman <S> Doone Publications - <S> HDL Chip Design , Douglas J Smith <S> And he have suggested this doc too: Xilinx Synthesis and Simulation Design Guide <A> Can you clarify what HDL you want to use? <S> The choices are basically Verilog or VHDL, [EDIT], and their relatives, Verilog-ASM and VHDL-ASM <S> (Analog mixed-signal). <S> [/EDIT]Verilog has some C-like syntax, which makes it easier to pick up if you've worked with C before, but this also makes it easy to develop bad habits - You can't program hardware in C, because it's all parallel! <S> Also like C, it assumes you know what you're doing, and it's easy to shoot yourself in the foot. <S> VHDL forces you to think in a totally different way, which is helpful, but difficult. <S> It is more verbose, and more likely to warn you if you do something strange. <S> See this Slashdot discussion , or this article . <S> EDIT: <S> The "Netlist languages" are not something I've used for design work (in a text editor), but I suppose that you could. <S> SPICE, Cadsoft Eagle's format, and EDIF are all examples (with very different purposes) that come to mind. <S> I've only used netlists to verify that my schematic is correct (does each connection in my Eagle schematic make sense), to tweak the abstraction provided by a simulator (SPICE, similar to the way one uses ASM statements in C), or to do export/import between different programs (EDIF). <S> The Spectre netlisting language is related to Verilog-A[nalog] and SPICE, and is designed for design and verification work. <S> MAST is a component modeling language which is compatible with Verilog-AMS and VHDL-AMS. <S> Searching for tutorials on these languages shows that tools which look like schematic capture utilities are often used, rather than programming in the netlisting language itself. <S> I'll also second the Xilinx Spartan FPGA, and a Digilent dev board. <S> However, I'd go with the Basys ($60) or Nexys ($100) if you don't need the Ethernet on the Starter board ($150) mentioned by O Engenheiro (Prices with education discount). <S> The Basys and Nexys are cheaper and therefore more popular in schools, so there are more tutorials and labs online. <A> Before making any things do 1, make sure that you really know everything about digital circuits, because that HDL don't create anything new, you only use these things on a different way. <S> So you can use one of the two books above, to do some exercises, ask you teacher the books that he recommends and use them or one of the two above. <S> Ask to you teacher wich FPGA do they use on the classes, if it's Altera, Xilinx, Lattice or other, if Altera make the download of the Quartus Web Edition, if Xilinx, the ISE Webpack, make the free download of one of these and try to learn about one of the softwares and do some of your exercises, simulations on one of them. <S> You are right, about 90% of the work on HDL are on simulators, so learn about the Modelsim simulator, and/or the ISIM simulator on xilinx, they commands and how to do testbenches. <A> wherever you end up working you will have to use the same HDL they already use - so to increase the chances of getting hired try and spend a bit of time with both Verilog and VHDL. <S> It used to be pretty simple: Verilog was used in the US and VHDL in Europe - <S> these days it's not a simple. <S> Upthread someone mentioned learning to 'think differently' for VHDL <S> - you have to do that for verilog too <S> it looks like C <S> but it's not - a good place to start is to look and see where wires and flops are created during synthesis - once you reach the point where you can see those, and can just 'see' timing hazards in your head <S> you're most of the way there <A> icarus verilog or verilator are what I would recommend for learning or playing with verilog. <S> ghdl is what I would use to play with vhdl. <S> Far from mainstream <S> but I would also recommend cyclicity-cdl.sf.net which has its own sim environment, etc and produces synthesizable verilog. <S> use and learn gtkwave for examining the .vcd files generated by the simulators. <A> I learned Verilog in college in one course. <S> The culmination of that course was the implementation of a 2-way Superscalar MIPS processor (30% of the class got it completely working; I was in the other 70%). <S> I think things in industry are by-and-large moving away from Verilog and towards VHDL. <S> That being said, there are plenty of online tutorials for both languages. <S> Here's one on VHDL <S> and here's one on Verilog . <S> You're going to probably want to use ModelSim <S> and you can probably use the student edition (I think it's free; maybe with restrictions). <S> Incidentally they recommend using Digital Systems Design Using VHDL 2nd <S> Edition as a Textbook. <A> Here's a cheap FPGA development kit that may be right for you. <S> However, I am not sure about the level of Open source tools that work with it. <S> The vendor's toolkit chains are available for free download. <S> I have heard that at the price point this kit is available for, it is worth going and getting it.
There are two HDL languages, they're VHDL and Verilog, ask to your professor wich language will you learn and try to see how it works: the syntax and how could you make modules on this and make a big review about ALL digital circuits.
What cable assemblies do you recommend? I would like to build my own .100 (2.54mm) cables to mate with standard single and double row headers, but the 'rectangular connectors' section of distributors websites is huge. Which ones do you recommend? Can you recommend an IDC system that works with discrete wires (not ribbon cables)? <Q> well, almost all of them that aren't specifically designed for ribbon cable or other specific cable types will work fine with discrete wires. <S> Most of the easy to use ones aren't true IDC connectors as jeanne mentioned, and generally speaking the crimping tools are really expensive for small scale work ( <S> $150 for the tool, which is really just a pair of pliers in the right shape is normal). <S> You can hack crimp them and solder carefully and be fine. <S> TBH any of the rectangular connectors in the correct shape/spacing are fine. <S> As far as i can tell in the production world its more or less a battle of who can provide the best automated tools for assembly as it is which <S> shroud/crimp is 'better'. <S> The twisted wire bundle things works OK as long as the signals on the wire don't have integrity issues. <S> If they do, do not try it. <S> I ran into very much the same problem in the past when having to connect 2 pcb's together with relatively high frequency signals (multiple channels of ~3mhz I2S). <S> We ended up using the very thin plastic style ribbon cable (FFC or Flat Flexible Cable), the stuff you see on LCD screens or inside cell phones. <S> I don't honestly to this day know a good supplier for small quantities of this stuff. <S> I just asked our factory in china when they normally used and they sent over a bunch of connectors and cables for me to test and match the impedance of ( i think it was 3M's FFC series but not sure). <S> Worked great <S> but I had a hell of a time attempting to find that stuff myself without it costing a fortune, like $5 for a 3inch cable, but like $0.40 from the factory. <S> If you can find it cost effectively, it really makes life easier for good controlled impedance interconnects. <S> If you do find FFC parts for a reasonable price in low quantity let me know how :) <A> We've used ITW PANCON "MAS-CON" series connectors. <S> (single row, available in 0.1" or 0.156" spacing) <S> They work pretty nicely, the crimper tool isn't very expensive. <A> It's not exactly what you asked for, but check out EMSL's article on Twisted Wire Bundles . <A> They aren't IDC, since you do have to strip the wires, but we use these pins and these shells or similar, depending on the number of positions required. <S> We have the correct crimping tool, which is something like this (but that may not come with the right die for those specific pins). <S> It's expensive, <S> but then it's actually a bit more complicated than a regular pair of pliers. <S> For one thing, it ratchets. <S> When you put the pin in it and start to ratchet it closed, the die will line up and hold the pin while you insert the wire, so you don't feel like you need three hands. <S> And unlike ordinary large automotive/appliance type crimp connectors, it doesn't just crush a tube in which you've inserted the wire. <S> Rather, the die bends the tabs of the connector around and into the stripped wire, and bends the other tabs around the insulation. <S> And it has an adjustable stop, so it will crimp each pin the same regardless of how hard you squeeze it. <S> But that's for production work. <S> For hobbyist use, you could roughly crimp these with small pliers, then carefully solder them. <A> Why do you want to mate to [EDIT] standard <S> , straight, unpolarized, non-locking [ <S> /EDIT] .1 <S> " headers? <S> I'd strongly suggest going with something that's locking and polarized. <S> The AMP-Latch and mini-JST series both fit the bill [EDIT] and have a 0.1" pitch. <S> [/EDIT] <S> Mini-JST needs a crimper, AMP-Latch has both crimping options and IDC (designed for ribbon cable, it will work with discrete wires <S> but I don't think you'll find anything marketed as such). <S> Remember that you can use .098" connectors as well, don't limit yourself to 0.1" for the 2/1000ths of an inch.
Look for the ones that best match your wire and look easy to crimp without the proper tool.
What is a general set of components for a robotics hacker? I am playing around with a few projects and looking at a few more online. I've had to make some trips to the local electronics shop for a few basic necessities like LEDs, resistors etc. It got me thinking about what would constitute a good set of basic and cheap components. Things that would be useful for random robotic/electronic projects. I have broken the set up into tools and components. I was hoping you guys can add/edit this and provide online links as well for future budding roboticists and electronic hobbyists. The primary requirement being cheap and versatile. My List so far, Tools Soldering Iron Multimeter A PCB Holder stand for help with soldering Bread board Solder and Solder remover Components Hobby resistor set (6 of each type for example) Capicitors LEDs L293 motor driver chips 555 Timer chips Potentiometers (Pots) Transistors <- (What type?) Voltage Regulators <- (What type?) Switches <- (What type?) Relays <- (What type?) Battery Holder case Header for power supply wires DC Motor(s) Servo Motor(s) Veroboard(s) PIC Microcontroller(s) <Q> We discussed a few similar questions previously (though never specifically for robotics): ICs for microcontrollers? <S> General components Equipment <A> An in-system serial programmer is a good tool if your going to get into micro controllers. <S> Also latching shift registers are handy to have around should you need to expand the digital pins on your µController - <S> I quite like using the 74HC595. <S> Micro switches and tactile switches are always handy, small, reliable, minimal bounce and not too expensive either. <S> Lastly - if you're not sure what value voltage regulators to get, why not get an adjustable one? <S> The good old LM317 works well, providing in excess of 1.5A over a 1.2V to 37V output range, it also has a negative voltage counterpart the LM337. <S> Well that's my tuppence! <S> :) <S> N.B <A> There's a nice list of "popular electronics parts" on the Open Circuits wiki. <A> For quick prototypes I would get some ShapeLock , its great for making motor mounts servo arms and horns, or any other plastic piece you can create. <S> I have used this stuff successfully to make a motor mount for a project a few years back. <S> The only other thing that I don't see on the list is a power supply, even a cheap hacked PC power supply would work since it does supply common voltages, +5v and <S> +12v at a decent current. <S> Transistors you cant go wrong with a mixed bag of common NPNs like 2n2222 or 2n3904 <S> PNPs are good to have in stock but not necessary in my opinion <S> Other miscellaneous parts that may be needed would be some sort of platform to base your bots on, <S> some use pre-built ones, but i prefer using RC cars and vehicles to modify.
- If you're prototyping robots a bag of Shape lock wouldn't go amiss.
Safety of making PCBs I've been making a few hobbyist PCBs at home and note that the photoresist developer and ferric chloride etch solutions are both pretty nasty chemicals that come with all kinds of warnings. So I've been extremely careful Wearing safety goggles while dealing with them. Wearing disposable gloves at all times and throwing them away afterwards. Wearing old heavy clothes so that a splash won't immediately touch skin. Rinsing everything with large amounts of water afterwards. My question is just how much of this is needed and how "nasty" are the chemicals? I shall continue to wear goggles as they are no trouble and there seems no point risking eye damage however unlikely. But what about the rest? If I get a single drop of the photoresist developer or feric chloride on me (and wash it off quickly) is that likely to be a huge problem? If I've rinsed something badly and there is still a trace of diluted chemical on there is that harmful? For example I'm throwing away my disposable gloves every time. I don't believe I get significant amounts of either on there but I'm not taking any risks. I could always wash them and use them again but they are cheap so I don't. But what risk is there that a few drops were on there and didn't get entirely removed by washing and they touched my skin? I'm of course not looking for someone to say go ahead, it's fine :) I'm just looking to know what the risks actually are so I can be an appropriate level of careful rather than over the top careful which I am now, which frankly can be a pain. <Q> The developer is simply a dilute alkali, I use 12g of NaOH in a litre of water. <S> It's quite safe but don't get it in your eyes and wash it off if you get it on the skin. <S> (I put the etchant and board in a small container in an old washing-up bowl with about 1" of just boiled water in it). <S> I've been making my own PCBs at home for about 40 years, using ferric chloride mostly. <S> The only accident I've had that could have been serious was when I was walking across the room with an open bottle of conc. <S> HCl in my hand, tripped, and a little splashed on my face next to an eye. <S> I thought it might have got in the eye, but the fumes were bad enough. <S> I immediately put my face under a tap and flushed the eye out for several minutes. <S> It was sore for a few hours, but there was no damage. <A> According to USA laws, at least, the manufacturer is required to make MSDSs available on request. <S> Simply doing a Google search with the product name and "msds" will usually get results. <S> An MSDS is a bit difficult to read, and there is no real standard format, but you should be able to find out what you need for protective clothing, eyewear, and the like. <S> Also included are many other topics, such as fire and explosion data, and HAZMAT transportation information. <S> Going beyond the MSDS; doing a search of the primary ingredients listed should turn up good data if you're interested in long-term effects such as carcinogens and the like. <S> I hope this helps. <A> Personally, I'm pretty cavalier. <S> But, don't get ferric chloride on your clothes, it never comes out. <A> I'd agree with Jesse, go to the official government stuff for details - if you're worried. <S> But.....from purely an experiential standpoint - To be honest <S> I've had ferric chloride on my skin more times than I'd care to mention, however I do use thick rubber gloves and ventilation whilst etching. <S> When I get it on my skin <S> I'll just stop..... <S> pop my PCB in a sink/bucket of water (if i'm etching caveman stye) <S> remove gloves, then get plenty of water on the area and give it a good wash off. <S> A while ago - I was alone at home etching <S> and I got a splash of ferric chloride in my eye! <S> .... <S> didn't have time to save the board...but got to the kitchen sink and put my eye under the tap whilst blinking franticly. <S> My eye was fine afterward, but it could have been worse (may have tripped and hurt myself!)... <S> so next time I'm etching alone <S> I'll take extra precautions with eye protection! <A> My worst chemical mishap was probably when I was supergluing some things together and a part slipped and splashed little glue droplets around the desk and me. <S> My first thought was, did I really manage to make drops of flying cyanoacrylate and what if one had hit my eye. <S> I still don't wear goggles while etching or even gloves (I use tweezers, wire, and cotton swabs etc to manipulate the parts), though I do in a lot of other things. <S> I tend towards paranoid carefulness in general otherwise. <S> I think the important thing in dealing with chemicals is general hygiene. <S> Don't let the chemicals touch anything you haven't intended to contaminate. <S> Always keep a separate spoon/measure/jar/tweezers/spoon for each chemical etc. <S> Store things in appropriate ways, label things and keep foodstuffs well away from toxic things. <S> Know the particular ingredients and their behaviour as well as you can. <A> An environmental concern is copper ions in the used etching fluid. <S> It's quite likely that down the sink, NaOH and even ferric chloride are not as nasty as copper salts. <S> Care should be taken when disposing of old fluid. <A> A year ago, I would have said "Anything that can dissolve copper must be a dangerously strong acid". <S> However, salt and vinegar are generally considered harmless enough to eat and drink,and I've recently come across people who claim mixing the two makes an acid strong enough to etch copper-clad circuits: Salt and vinegar etching , also etching FabFM radio smt pcb with Salt and Vinegar . <S> Perhaps it would be less hassle to use salt and vinegar, even if it etches boards a little more slowly, rather than spending a lot of time and emotional stress being over-the-top careful and worried. <A> From my own experience, the ferric chloride is something you have to be very careful to avoid damaging something near (like furniture). <S> You have to store it very well, preferably in an airtight container inside other airtight container. <S> Its evaporation or spills will stain practically anything it's near of. <S> Be especially careful about aluminium objects, it reacts instantly with them corroding completely and liberating gas ( <S> if you drop a piece of aluminium in the ferric chloride solution it'll look like an alka-seltzer tablet). <S> When in contact to the skin it'll not burn or make damage (provided you wash instantly), but it'll stain (to the point it'll take days to vanish). <S> If you buy it in powder form and dillute yourself, do it in a ventilated place since it'll release gases when dilluted with water. <A> as far as the toxic nature of these chemicals, the only thing you really need to worry about is the resulting copper chloride. <S> That's not too hard, though, and getting a bit of it on your skin isn't terribly dangerous. <S> That's about as bad as it gets.
Ferric chloride is quite safe, just wash it off if it gets on the skin. Copper is quite toxic and should definitely not be ingested. I always wear rubber gloves, both for protection and so that I can use hot etchant with manual agitation For a definitive answer, consult the Material Safety Data Sheets (MSDS) associated with the products you are using.
Best humidity level for electronic shops? What is the best humidity level for an electronic shop? On one end of the scale, you will have problems from corrosion due to high humidity and condensation, but at the other end there will be serious problems from ESD. I've worked in shops at either extreme end of the scale, and would imagine the ideal level being around 50% relative humidity. Thoughts? <Q> There are also ergonomic factors, human beings work best at 40% to 60% RH. <A> However, below 35% or 40%, you should start being extra vigilant. <S> For example, it's always a good idea to keep styrofoam packing material, wool sweaters, polyester fleeces, and rolls of packing tape away from your ESD-safe work area, but when the humidity is very low, even ordinary paper can start to be a problem. <S> An ordinary laminated surface that might be passable at high humidity can start to cause problems when the air gets very dry. <S> The professionals use grounded mats on the workbench surface all the time. <S> When the air is very dry, ionizing fans become necessary. <S> So, you can work with almost any R.H., depending on the level of protection measures you have in place. <A> 50% seems a bit low. <S> Corrosion of metallic parts has never been an issue in my experience, and condensation is usually not an issue in a climate-controlled building unless you bring metallic parts in from the cold in winter. <S> I'd probably shoot for something in the 70% range to be safe.
Just working with grounded wrist-straps, and keeping major ESD generating clutter to a minimum, you shouldn't have much problem down to about 40% relative humidity.
How to find the ESR of a capacitor I am building a power supply circuit, and the switching regulator ( L4963 ) calls for a low- ESR output capacitor. The capacitor in question is C3 of the evaluation board circuit. What does "low" mean? How low? Also, how do I find or calculate the ESR for a capacitor whose datasheet does not have a parameter called ESR? <Q> If a datasheet just says 'low ESR' without specifying a value, you are usually fine with any style of capacitor with a relatively low ESR. <S> All this really means that you should avoid cheap unrated aluminum electrolytic capacitors, since their ESR is terribly high and can be several ohms. <S> In this case it wants a 'low-ESR' capacitor for the 1000 µF output capacitor. <S> I don't think I've ever seen a ceramic 1000 µF capacitor and a 1000 µF <S> tantalum capacitorwould probably cost US$50, so you are going to have to track down a low-ESR aluminum capacitor for this application. <S> The output ripple will decrease linearly with the ESR of the capacitor, so lower is better up to whatever price you want to pay. <S> As an aside, that is a ridiculously high required output capacitance for a switching regulator in that voltage range. <S> You may want to take a look around for a regulator that meets your needs, but is stable without such a requirement. <S> Don't get me wrong, usually the more capacitance the better, but 1000 µf is really high for a 1.5 A power supply. <A> It's 'equivalent series resistance', and is somewhat frequency dependent. <S> Basically it's the unavoidable ordinary resistance that comes along with the capacitor. <S> Resistance just dissipates power, which results in heat, which is generally no good for capacitors, especially electrolytics. <S> Just speculating now - On that data sheet you linked, the salient parameter looks like 'tangent of loss angle'. <S> If one assumes that 'loss angle' is the angle away from a purely capacitive reactance, then the tangent of that angle would be the series resistance divided by the capacitive reactance, in which case this number being low would imply ESR to be low. <A> How "low" depends on the efficiency and reliability <S> you are tryingto achieve. <S> For low ESR capacitors the manufacturer will supplythe values. <S> Search for Nichicon low ESR capacitors and you will find partsthat have a low ESR. <S> The VR series is not a low series resistancecapacitor. <S> The PM Series is and the ESR is specified in the datasheet. <S> Nichicon (which makes excellent capacitors) may have some newer series. <S> The ESR is critical to the life of the capacitor since as ESR increasesthe temperature of the capacitor will increase which will decreaseits life. <A> As far as numbers would go: A low ESR cap for a switcher should usually have not more than a few 10 mOhm. <A> ESR is frequency and temperature dependent. <S> Most datasheets will list the ESR for a number of discrete frequencies, which may or may not be your switching frequency. <S> If you have an LCR meter you can connect up the capacitor and set the frequency and measure the ESR. <S> This is important for calculating the thermal loss inside your capacitor. <S> It comes back to Ohm's law ; for your switching frequency, there is an ESR, which is R, and you have current flowing into and out of the capacitor, which is I. Square it and multiply by R <S> and you have the power loss inside the capacitor. <S> The capacitor datasheet will also state its thermal resistance, so you can estimate the temperature you will be running your capacitor at. <S> Select a suitable temperature rating for your application. <A> In this case I think the low ESR is needed to get a low ripple on the output voltage. <S> The current through the inductor will have some ripple, and assuming a constant output current the capacitor will have to absorb or supply the difference to the output. <S> Multiply this ripple current with the ESR and you get the ripple voltage. <S> You can measure ESR by charging and discharging the capacitor with a relatively high current switched by a function generator, and then measure the ripple voltage with an oscilloscope. <S> I've seen 170 mOhm in practice for a low ESR SMD electrolytic capacitor. <S> If I remember correctly the voltage difference was 0.5V <S> so the current ripple must have been 3A (limited by the power supply).
Lower ESR means that the capacitor is more like an ideal circuit element.
Anything special I need to know about RS232 & FT232R? I'm trying to interface an XSens IMU with my computer, and I'm running into interesting difficulties. The IMU has an RS232 connector that just uses the pins VCC, GND, TX, RX, nothing else. The SDK comes with it has a custom RS232-USB adapter that uses the FT232R and MAX3160, but apart from that it doesn't seem to do anything special. The manufacturer claims that the IMU uses standard RS232 (and I have no reason to doubt them), so, in order to save space (their converter is quite bulky), I am trying to use a Sparkfun FTDI Basic Breakout 5V . If I set all the COM settings the same (baudrate, parity, stop, etc), and I connect to the device, I do get data back, but it just seems like gibberish. I issue commands, the TX LED on the FTDI blink, the RX one too, and I get data, but it's nothing like what I am expecting. Can anyone think of any "gotchas" I may be missing? Is there a FooBar that needs to be connected to the DingDing to Actuate? <Q> Standard rs-232 (like your IMU) and TTL level rs-232 (like the FTDI chip) are different. <S> Standard rs-232 switches between +V and -V <S> ( where V was originally 12, but now most devices will work on much lower voltages). <S> TTL level rs-232 switches between 0 and 5V. <S> You need an rs-232 transceiver to convert the voltages, such as that MAX3160 chip <S> (Though that's an unusual one - something like the max2332 is more common). <S> The USB to TTL level rs-232 converters like the one you linked to are are used to connect to a microcontroller, not to a typical rs-232 device. <A> Are you sure the voltage levels are compatible? <S> Standard RS232 has ±12V levels, which are usually converted by some MAX chip to TTL levels. <A> Looking at the specs for some of the devices on that site, they list the digital interface as being 'max 921600 bps' - so unless you have very good reason to believe the device is operating at that particular baud rate, it would be worth your while to try talking to it at a few other baud rates, especially if you have a good idea what the data is supposed to look like. <S> I'd set my terminal for 115200 and see if the data made any sense at that rate, then, work down the baud rate scale. <S> If you get to 9600 and it still looks like gibberish, go back to 115200 and work up. <S> A rate of 921600 is almost unheard of. <S> It's a standard multiple, but I honestly haven't seen anything push RS232 faster than 115200 before. <S> By the time it becomes necessary to use faster rates than 115200, designers usually switch to some other, more reliable interface. <S> Btw, I'm still just assuming that you've connected the device to a PC com port and have some documentation that suggests what the data format is. <S> If it's an option to select a baud rate, use 115200, it will be much more reliable, assuming it is compatible with your overall data rate needs. <A> One annoyance I've had with FTDI chips, which is probably not the cause of your problems but potentially might be, is that if the remote device sends what the FTDI perceives as a "long break", the FTDI will discard information which it has received from the remote device but not yet forwarded to the PC. <S> This can cause problems in two ways: <S> Some embedded devices idle with their serial output low; when they have something to say, they turn on their serial output, send some data, and then go back to idling low once they've said it. <S> If the embedded device is feeding something which can go to sleep when its serial input is low for an extended period and wake up when it goes high, this feature may provide an effective means of wakeup signalling without requiring an extra pin. <S> Unfortunately, the remote device switching off its serial port may cause the FTDI to drop the last portion of the data sent by the device (I've checked with a scope--the data was sent before the line went dead, but the FTDI dropped it anyway). <S> When using a typical UART which is set for a faster baud rate than the device to which it is connected, one will generally receive garbage data that contains an identifiable subset of possible byte values. <S> For example, if one is configured for 38,400 and the remote device is set for 9600, one will receive properly-framed byte values and 80, F8, and improperly-framed byte values 00 and 78. <S> Receiving lots of those particular byte values can make it easy to identify the problem. <S> Unfortunately, each time the FTDI sees an improperly-framed 00, it is prone to discard the data preceding it. <S> Consequently, instead of seeing readily-identifiable garbage data, one may end up seeing nothing. <S> For this reason among others, I have something of a love-hate relationship with the FTDI chips. <S> I use them, and they're reasonably convenient in many ways, but they're not as simple a drop-in replacement for a UART as one might like. <A> If you are using their software, make sure to change your FTDI's VID/PID to match theirs. <S> Otherwise their software won't recognize your custom serial converter
In your case the Sparkfun FTDI breakout board has TTL levels (0/5V), while the MAX3160 can do RS232 and RS485(!), so there is a mismatch.
What to use for the high-side (anode) drivers of a common anode LED matrix? I'd like to multiplex rows of LEDs with a constant current sink driver. Should I just use BJTs to switch current into the rows of anodes, or is it better to use FETs, an array of FETs, or the same packaged into a convenient IC? It's easy to find current sinking ICs but I'm not sure what to search for on the sourcing side. I would like to build something substantially similar to the Rainbowduino, http://nkcelectronics.com/rainbowduino-led-driver-platform.html . The Rainbowduino lights 24 LEDs at once with 24 current sinks and one current source using a Darlington array as the so-called "Super Source Driver", then it lights the next row of 24 and so on for 8 rows. Very standard. I would like to find a substitute for their unavailable-in-the-USA Darlington array. What do I need search for on digikey/Mouser to find an IC containing an array of current sources? <Q> You can build your own common-anode driver out of discretes like this: A forward-biased diode at the zener (D2) cathode will let you use 1 zener and a bunch of standard silicon diodes for lower cost and easier availability. <S> Remember that discrete devices are available in arrays, which will greatly simplify breadboard or perfboard construction. <S> However, this will reduce your available power significantly. <S> With that circuit R1, D2, and Q1 all dissipate minimal power, so can be <S> SOT-23 and 0805/0603, or low power arrays. <A> There isn't anything wrong with using discrete devices (BJTs or FETs). <S> FETs will get you more bang for your buck (lower losses, easier driving) but BJTs are cheaper. <S> It's your call. <S> 750mA across a 1.4V BJT drop is just over a Watt; I understand that you're duty-cycling the drive, but I'd suggest P-channel FETs with small NPN switching transistors driving the gates if I were to do it myself. <S> You're probably going to want to drive those LEDs from a higher (12V?) supply in order to maximize brightness, and the transistor will give you a nice open-collector gate driver (although the pull-up resistor may end up drawing some current.) <S> Without knowing more about your design <S> it's hard to say what is best. <A> and one current source using a Darlington array as the so-called "Super Source Driver" <S> This is maybe just a terminology thing, but you don't want a current source, you need a voltage source. <S> Current will be controlled by your constant current sink driver. <S> A current source wouldn't be good anyway, since the sourced current will depend on the number of LEDs that's on. <S> Let's look at your requirements first. <S> You need 8 outputs, each of which has to drive 24 LEDs. <S> The outputs will be 1:8 multiplexed, so each LED will have to served 8 times its nominal current to have the same luminosity as when statically driven. <S> I'm presuming common 20mA LEDs. <S> That means each output has to supply 24 \$\times\$ <S> 8 \$\times\$ <S> 20mA <S> = <S> 3.85A. <S> That's a lot. <S> I'll presume you have a low voltage power supply, like 5V, and that you want to control your driver using a logic level. <S> There are high side driver arrays. <S> The AMIS-39101 , for instance, looks nice, but isn't cut for the required current. <S> How about a discrete solution? <S> If we can find a logic-level P-MOSFET that can supply 4A pulsed we'd be there. <S> Let's take a look at the <S> Si2377EDS <S> I found at Digikey. <S> \$R_{DS(ON)}\$ is 61m\$\Omega\$ at a 4.5V \$V_{GS}\$ and \$I_D\$ of 4.4A. Power dissipation is then (4A)\$^2\$ \$\times\$ 61m\$\Omega\$ \$\times\$ 12.5% duty cycle <S> = <S> 120mW. <S> That's pretty decent! <S> The \$I_D-V_{DS}\$ graph shows that even at 2V \$V_{GS}\$ we have plenty of current. <S> So, just use 8 Si2377EDSs, possibly with a gate resistor, and you can drive the lot from 8 microcontroller outputs. <A> A Maxim <S> MAX7219 can handle up to 64 LEDs as a current source. <S> I wrote a short review about it here .
All in one ICs are more convenient and take up less space, but are more expensive. If you're doing it on a PCB, it's perfectly fine to do it with discretes (as long as you have room.)
Why is it important not to exceed Vcc at the input to a logic gate? What happens to a logic gate (besides magic smoke discharge) seeing a voltage greater than Vcc? Is it just because the gate was not designed to handle a higher voltage than the recommended Vcc, or is it also usually important to limit the voltage to the actual Vcc even if the chip works within a range of voltages? <Q> Almost every IC you can buy has a number of "hidden features" that are assumed to be present and thus not discussed in the datasheet. <S> Among these are body diodes/ESD suppression diodes. <S> These guys generally hide on every I/ <S> O pin on every device, from basic logic gates through memory to high-end microprocessors. <S> They route any voltage that is greater than VDD (supply voltage) or lower than VSS (supply common) to the appropriate rail. <S> If you apply a voltage in excess of either of these limits, the body diodes become forward-biased and effectively clamp the level at the pin to either VDD or VSS. <S> This sounds like a good thing and generally is, but they are very small devices and cannot dissipate much power. <S> You can end up damaging this diode (shorting it or blowing it open). <S> In the former case it can lead to "stuck" I/O pins, and in the latter case, the next overvoltage can destroy the input. <S> Open-collector outputs are handy for being able to control some outputs, as pingswept mentioned already. <S> Putting small resistors in series with inputs which may come into contact with nasty voltages, and/or using external diodes (even an 1N914 is HUGE compared to the protection diodes on the IC itself) is a good way to help protect devices. <S> Of course, properly designing your input or output circuitry to handle continuous or repeated transient events like these can be a design challenge in and of itself. <S> Generally speaking, if you are worried about blowing an expensive part, buffer the input or output with (much) cheaper and preferably socketed buffer ICs. <A> It's the actual VCC that matters. <S> Logic gates (and microprocessors) have a diode to VCC and a diode to GND at every input and output pin.(Except for a few chips that have a few "high-voltage tolerant" open-collector pins, as pingswept mentioned). <S> If you externally drive an input higher than the actual VCC at the time, current will flow through that diode. <S> As long as you limit the current through that diode below the maximum current listed in the datasheet, slight over-voltage won't do any permanent damage. <S> However, even when limited to very small amounts of current, this is enough to disrupt analog circuits on the chip -- the digitized value from an ADC reading one analog input pin can be totally wrong when it is upset from a voltage slightly above VCC on some other pin. <S> seemingly small currents through that diode can locally over-heat the region on the chip around that pin, destroying functionality associated with that pin. <S> A person can spend days trying to figure out why his software seems like it mostly works OK, except for stuff connected to that one pin. <S> (Guess how I know this?) <S> slightly larger currents through that diode can overheat and destroy the entire chip. <A> Two issues: Protection diodes from an input to GND and VCC will allow large currents if the voltage at the input is above VCC or below GND. <S> Eventually, the diodes might heat up a lot and become low-ohmic, i.e. they will act like a short from the input to VCC or GND. <S> Also, latch-up may occur. <S> This means that a parasitic thyristor hidden inside of the IC's input circuit will turn on and remain turned on as long as the external voltage is present and causes a current to flow into the input. <S> Eventually, the input circuitry might heat up and permanent damage will occur. <S> There are two things to watch in the data sheet: input voltages relative to the actual VCC applied to the chip (they read something like V_in must be less than VCC+0.3V and greater that GND-0.3V) and absolute voltages at the input pins (e.g. V_in must be less than 6V). <S> Exceeding the absolute limits will likely blow the gate of the CMOS transistors at the input. <S> Some logic gates designed for interfaces between 3.3V logic and 5V logic can handle 5V at the input when the IC itself is supplied with 3.3V, but these are rare. <S> These ICs lack the protection diodes from the input to VCC (and usually have z-diodes from the input to GND and some other tricks to prevent ESD damage).
Exceeding the limits relative to VCC will likely blow the internal diodes.
Difference between Mosfet and Voltage Regulator? I'm new to electronics and was wondering what was the difference between a Mosfet and a voltage regulator? <Q> MOSFETs and voltage regulators often come in similar-looking packages and usually have 3 pins each, but their functions are different. <S> A voltage regulator takes in a high voltage, like 12 V, and puts out a lower voltage, like 5 V. <S> The canonical example of a voltage regulator is the LM7805 . <S> They tend to be fairly inefficient (some of the power is lost as heat). <S> A MOSFET is a semiconductor switch. <S> It varies the resistance between two pins in response to a voltage on a third pin. <S> Inside the MOSFET, the voltage on the third pin (the gate) pulls electrons into a narrow path between the other two pins (the source and drain), allowing electricity to flow. <S> Here's a decent diagram . <A> In very basic terms, a voltage regulator is a device for building a power supply, whereas a mosfet is something you use to build an amplifier. <A> A MOSFET is a single transistor that will be able to provide a regulated voltage if used inside of a whole voltage regulator circuit (or IC). <S> To build a (linear) voltage regulator, one needs a pass element (regulated "valve", e.g. MOSFET or biolar transistor), a voltage reference and a circuit that compares the desired, regulated output voltage to the reference voltage and adjusts the pass element such that the output will remain in regulation. <S> Thus, a MOSFET may act as one part inside of a voltage regulator.
A voltage regulator is basically an integrated circuit that has several transistors within it, while a mosfet is exactly a single transistor.
What is a differential ADC? How does a differential analog to digital converter differ from a regular ADC? <Q> A differential ADC will measure the voltage difference between two pins (the plus and minus input). <S> A single-ended ("regular") ADC will measure the voltage difference betweenone pin and ground. <S> A lot of differential ADCs can be configured to give you twice the channels insingle-ended mode. <S> For example the AD7265 has 6 differential channels and 12single ended channels. <A> A regular ADC samples <S> it's inputs in the range 0V to AVcc, where AVcc is often configurable (5V, 2.56V, user input etc). <S> A differential ADC shifts the lower reference from 0V to some other value - <S> either a user input on a second analog input, or a internal reference. <S> This is helpful for measuring small signals that have a large DC offset - eg measuring changes of 100mV in the range <S> 2.5-2.6V. Readings for voltages lower than the offset are hardware dependent - can give negative readings, absolute values, or zero. <S> A typical application is in a load cell which has a small voltage change at some DC offset. <A> As others said, it has two inputs for each signal, one of which is subtracted from the other. <S> This gives you more signal-to-noise ratio because The maximum input level is 6 dB higher (2 x amplitude) <S> Uncorrelated noise of the two inputs combines to be only 3 dB higher (sqrt(2) <S> x amplitude) <S> It cancels out any common-mode noise. <S> (If the ADC's ground voltage is fluctuating relative to the ground of the thing being measured, for instance, both inputs will move up and down together, and this will be cancelled out. <S> If the two inputs are both driven from the same op-amp and some of its power supply noise is getting into both outputs, that will be canceled out. <S> etc.) <A> Another point not yet mentioned is that a typical ADC which is designed to resolve 0-3 volt signals to one millivolt precision (12 bits) might not have much better than one-millivolt precision when trying to resolve a 0.1 volt differential signal riding on a two-volt common-mode signal <S> (e.g. it might have 8 bits of useful precision), whereas an ADC which is designed to resolve small differential signals would be able to perform much better; a 12-bit ADC could be designed for such purposes to provide 12 bits of useful precision with a 0.1-volt signal without having to be designed to provide 16 bits of precision on a larger signal). <A> It's hard to say exactly what you're talking about without a reference, but I'm guessing that you're talking about an ADC that has a differential pair input. <S> Differential pairs are nifty things that allow you to double the perceived voltage swing without raising the supply and inducing additional noise. <S> Essentially what goes on is that instead of having a signal referenced to ground, the two wires are total opposites; when one line is at +1.3V, the other is at -1.3V. <S> The voltage of either line to ground is only 1.3V, but since the ADC is converting the difference of the voltage on these signals, you have 2.6V. <S> I assume you're talking about ADCs which sample differential signals. <S> Differential pairs are used where ever you want to limit induced voltages. <S> Ethernet and USB are both differentially signaled. <S> Lots of RF is differentially signaled. <S> If you do some hunting on Google you'll find LOTS of more information. <A> In principle it takes the difference between the voltages on the two terminals and converts that into a 2's complement binary number. <S> I would say it's common to see this type of ADC used for signals that vary around GND, since in principle negative conversions have meaning in this context. <S> A single-ended ADC is a one-terminal device, where the voltage is converted to a binary number by comparing it to an internal reference (say ground). <S> Typically these are used for sensors that have output a linear voltage in proportion to the phenomenon they are sensing.
A Differential ADC is a two terminal device.
Blink an LED with just a capacitor? Is it possible to blink an LED using just a capacitor? (and maybe a resistor). For example, if I want to LED to blink once every 2 seconds. Is that possible? I know it can be done with a 555 as well as with a capacitor and transistor. <Q> Blinking an LED can't done with just passive elements. <S> Interestingly, you can accomplish periodically blinking a light, with a resistor and a capacitor, if your light happens to be a neon discharge lamp. <S> The reason a neon bulb will work and an LED won't has to do with their current-vs-voltage behavior. <S> In the LED's case, no matter what the voltage across it, some current will be passed. <S> This effectively keeps the cap from charging up, as an operating point is established that is determined by the LED and the resistor. <S> You'll just get a constant glow of some intensity. <S> But with the neon bulb, no current is passed until the voltage exceeds some threshold, which is the breakdown voltage of the neon gas. <S> This allows the capacitor to charge up while the bulb remains dark. <S> When the breakdown voltage is reached, the gas ionizes, and the energy stored in the capacitor is dumped through it, producing a short, bright flash. <S> Basically you need some device in the circuit that operates like an active device. <S> In the case of a neon bulb, the bulb itself is the active device, having distinct conducting and cutoff behavior. <A> If you visit here there are instructions on how to do it with a 555, or here with capacitors and transistors: <A> You could do it with a high voltage, current-limited supply and a spark gap, which is sort of like a capacitor. :D <A> A completely orthogonal approach, <S> but you could use a thin (read: high-resistance) bimetallic strip, or even a thin enough "muscle wire" to blink an LED, probably with a time scale of a second or two. <S> This wire or strip heats up due to the current and deforms, breaking the circuit. <S> It cools, making the circuit again. <S> This is the standard "blinking christmas light" circuit, and it works fine for LEDs too. <S> This sort of thing is pretty easy with a high current LED <S> (you didn't say what type you're using!), but if it's a low current LED, you'd probably need a moderately high voltage (maybe 12V) and corresponding resistance to drive the LED properly while heating the wire at the right rate. <A> I believe what you are looking for is an astable multivibrator. <S> At it's heart are just two capacitors and two transistors with a couple of resistors. <S> wikipedia has an informative entry about it: http://en.wikipedia.org/wiki/Multivibrator <A> Diacs, tunnel diodes and gas filled discharge tubes, like aneon, work since they have at least one negative resistanceregion. <S> In general, a reactance in parallel with a negativeresistance will oscillate. <S> Relaxation oscillators, producedby four-layer semiconductor devices, UJT, SCR, SCS, providenegative resistance for exploitation, which leads to the onand off switching points being different. <S> The techs call it hysteresis, neons exhibit voltage hysteresis, tunnel diodescurrent hysteresis, diacs both, etc. <S> Triacs have an unequaltrigger point gate-to-M1 and gate-to-M2, which causes theirasymmetric switching with excess harmonic generation. <S> Usinga diac in series with the gate almost fully fixes this, butonly because it adds series negative resistance to overrulethe asymmetric positive resistances G-M1 vs G-M2 before thepoint of no-return, with negative resistances adding givingdouble regenerative effect, which speeds the triac on. <S> If avery careful design is done, then you can oscillate a triacusing aDC supply and RC network... <S> Hysteresis is also at the heart of a Schmitt trigger, whichmany interesting digital circuits exploit. <S> The CMOS 4093 isa favourite chip for building various natty circuits... <S> Of course, you could always use an LED with a flashing chipbuilt in, like RS 585-387, 5 mm red at 80 cents each... <A> Some sort of trigger circuit is needed to discharge the capacitor into the LED when it has charged up to a certain level. <S> That can't be achieved with a resistor. <A> I haven't tried this, but I just thought of it while reading JustJeff's excellent answer. <S> What if you took a (reverse-biased) zener diode in series with the LED, that pair in parallel with the cap, and a resistor from the (led+zener)-cap node to +V? <S> Is the zener's reverse leakage current low enough to allow this to work? <S> Nevermind... <S> I'm an idiot. <S> The resistor to +V would be above the zener breakdown voltage and thus the circuit wouldn't work. <S> Editing with this instead of deleting the post for posterity. :-) <A> Just a cap and an LED won't do, but you can use a Diac (similar to two anti-parallel Z-diodes with roughly 30 V) with a series resistor and an LED. <S> If you are able to safely work with AC voltages from the mains outlet, you can try to charge a cap from the mains via a diode with a high-ohmic resistor. <S> Once the cap reaches the Diac's (+LED's) breakdown voltage, a part of the stored charge will go into the LED and make it flash. <S> The next flash won't occur before the Diac's breakdown voltage is reached again. <S> (-> relaxation oscillator, kinda similar to what some others suggested, just that spark gaps or neon bulbs are replaced by semiconductors...) <S> I found the idea in the German hackers' magazine Elektor many years ago...
To blink an LED, you need a couple of transistors (e.g., multivibrator configuration) or possibly a single SCR (biased to have a suitably low break-over voltage).
What are the Best Starter Supply Kits? I am just getting started out learning electronics and I keep finding myself having to order capacitors and transistors and other parts for simple projects. What are the best starter sets for a beginner? i.e. who sells a good set of capacitors for a newbie? transistors, resistors, LEDs, etc... Im interested in both complete sets (that includes different types), as well as individual sets (say, for just capacitors). Ideally, the kits are weighted toward pieces that you will use more often. Any suggestions? <Q> In answer, I'd try go for the Basic Prototyping Parts Kit from Electronix Express, and possibly the supplement if it has stuff you want. <S> As a meta-answer, there are a whole bunch of threads on topics like this one. <S> I propose that we set up a FAQ, dedicated tags, or community wiki/sticky for this kind of question on supplies, stocking, and equipment, including: <S> What is a general set of components for a robotics hacker? <S> Which electronics components should I always have on hand? <S> Long-lasting electronics items <S> What's the best way to store and categorise resistors/capacitors/ICs/etc? <S> Personal electronics tool kit <S> Which equipment for electronics should I always have on hand? <S> Best Electronic Kits and this question, <S> What are the Best Starter Supply Kits? <A> SparkFun has a few various types of kits: <S> Inventor's Kit Tool Kit Arduino Flex Starter Kit Sensor Kit Robotics Kit - Robo-CIRCLE <A> You can get kits of individual components for pretty cheap on eBay. <S> For example: 1000 resistors (50 values with 20 pieces each) for $9 500 capacitors for $20 (21 values with different quantities...more of the cheap ones, less of the expensive ones obviously) <A> <A> This Arduino starter kit from .:oomlout:. <S> is fantastic, it's a really good price and you can buy it with or without an Arduino Duemilanove <S> (Programmable micro controller ) - plus .:oomlout <S> :. is a groovy company too!
Rapid Electronics supplies component kits.
Which programmers work with the Atmel Raven boards? This post answers the question of if it possible to program an Atmel AVR Raven board with avrdude or not. Yes, it is possible. My question is which programmers will work with the Atmel Raven + avrdude? I'm trying to avoid buying the $300+ AVR JTAGICE mkII. There are clones available for $50 (for example the AVR-ISP500 from Olimex). Can anyone confirm having used a clone programmer with avrdude to program the Atmel Raven boards? Which programmer(s)? <Q> Any programmer/debugger that supports the AVR controllers on the Raven boards should be suitable, I'd use an AVR Dragon ($50) instead of the specified JTAG ICE Mk II. <S> Clones like that one available from Olimex only support programming, not debugging. <S> The JTAG ICE Mk II might still be available for half-price from Arrow. <A> <A> Summary of what I have found: The Raven boards as well as the Raven stick both contain 10-pin, 50-mil JTAG interfaces. <S> The pins must be soldered on by the user but are also included in the evaluation kit. <S> A 50-mil to 100-mil adapter allows connecting the JTAG interfaces to programmers. <S> The Raven boards but not the Raven stick include 6-pin, 50-mil ISP interfaces. <S> The pins for these must be soldered on as well <S> but no 6-pin units are shipped with the evaluation set. <S> However, as they are only header pins, the 10-pin units that ship with the evaluation set can be broken off to create 6-pin units. <S> (See link , search for “ISP connectors”). <S> The ISP interfaces on the Raven boards are faulty; VCC and GND are not connected for the 1284p MCU. <S> Atmel has suggested a workaround by jumping those pins to the VCC and GND pins for the 3290p ISP header. <S> (See link , search for “7 July 2008”). <S> The Raven stick does not contain an ISP interface at all, however, clever hacking and soldering can change that. <S> See here <S> (search for “USB stick”) and here for more information. <S> To summarize: it is possible to use a cheap ISP programmer with the Raven boards however it will require some extra soldering on the Raven boards in addition to adding the pins and it will also require quite a hack to the Raven stick. <S> Nevertheless it is possible and has been done before. <S> Which leaves with the recommended JTAG interface to program the Raven boards and stick. <S> JTAG programmers can be expensive. <S> The Atmel JTAGICE mkII programmer and debugger goes for around $300. <S> Clones are cheaper, for example the Olimex AVRISP-500, and while the clones don’t allow debugging more importantly they do not support all AVR chips. <S> The AVR Dragon goes for around $60 and supports JTAG albeit with its debugging capabilities artificially limited to the first 32kb of an application so as not to cannibalize sales of the higher end JTAG device. <S> Nevertheless, I find the Dragon to be the best choice.
I use the TuxGraphics AVRUSB500 to program my Raven-USB (after wiring on the ISP header )
Construct RFID tag to turn on/off? I am a very novice chiphacker and am asking for ideas on how I might implement something like this. I am about to start an RFID project, which is the easy part. RFID readers are cheap, arduinos are cheap, and RFID tags are cheap. But I want the ability to turn the RFID tag "on" or "off". I want to be able to say "when this happens, then allow yourself to be 'excited'". The project I'm working on is testing for the presence of a liquid (which has ions in it.) So one high-level solution would be "separate the RFID chip from its antenna. When the liquid is spilled, it 'shorts' that connection and now the tag may be excited." So my question is this: first, is there any mechanism for turning a tag "on"? There are plenty of ways to turn them "off" (basically destroy the tag) but nothing that works in the opposite direction. And how farfetched is the "liquid" idea? Might there be some resource that could help me understand what possible workarounds would be, or different attributes of different kinds of RFID tags? Or even something that tells me why this won't work? <Q> It might actually be just a little easier to make your own RFID in this case. <S> You will need a very low power microcontroller (an attiny or small PIC is typical) with an antenna and a small number of discrete components. <S> Here's a link to something similar: http://micah.navi.cx/2008/09/using-an-avr-as-an-rfid-tag/ <S> With that, you can arrange for the RFID micro to power on when it gets power from the antenna, perform its sensory operation, and then respond based on the result of the computation. <S> Obviously, the available current from such a setup is pretty small, so unless the sensor works well on very small voltages and currents, you may have a hard time without an external power source. <A> You could then 'read' the tag and when the tag is being powered by the reader you could have the microcontroller perform a check of your liquid sensor and return an appropriate value to the tag reader for wet or dry. <A> There are certainaly RFID tags with sensors coming onto the market soon. <S> I don't know if they exist yet. <S> But batteryless wireless sensor networks are going to be a big thing soon. <A> One researcher from Canada is cheaply/easily creating his own RFID tags so he can do something similar; to add other components to them to augment their functionality. <S> Really cool stuff! <S> Check <S> this out.
I've heard of RFID tags that have small amounts of read/write memory in them so it might be possible for you to get a tag containing a microcontroller.
What is the right clock chip for making a speedometer with an AVR I am building a hot rod and I decided to make a speedometer myself with a 3 digit nixietube display. I am planning on using an Atmel AVR microtroller (ATmega32 I beleive). I would like a CMOS clock that I can use to compare time for to keep the speedo as accurate as possibile. What is a good clock chip to use? How to I wire interface it to the AVR? How do I properly use it in software? Here is what I have so far: Pulse generator for transmission (sign wave, will use the selfpowered 4069 square wave converter circuit but power it off the psnot the wave) Nixie tubes and sockets Atmel microntroller and socket Nixie tube driver chips Programming socket for AVR I would like to make one order to Mouser and get the hardware breadborded ASAP so any help is appreaciated. <Q> Your speedometer needs to measure the elapsed time between two pulses, and it doesn't need to know the time of day. <S> I'd consider using the AVR's calibrated internal oscillator. <S> Its +-1% deviation from the nominal frequency is probably more precise than the circumference of your vehicle's tires. <S> If that's not good enough for you, spend an extra fifty cents for a crystal oscillator. <A> I would not worry much about the AVR internal oscillator accuracy, it is good enough when compared with the tire inflation varying so much based on temperature of the day, the asphalt, how aggressive you drive, etc, it may change the circumference in serious percentage. <S> Once you can do the calibration and get the best you can from the gadget, it is okay. <S> An informative speedOmeter does <S> just that, inform you, if it is showing 37mph instead of 36mph, that is not a dramatic or traumatic difference. <A> You can probably use the chips oscillator. <S> I did a similar thing <S> (well I used a two line lcd display) with an old PIC. <S> The sensor on the transmission sent out so many thousands of pulses per mile, which gives you a fair amount of room to calibrate for tire size and gear ratios, etc. <S> So you could choose any number of solutions from measuring time between individual pulses to measuring 10 pulses or something like that, with a timeout where you clearly know the car has stopped and the speed is zero. <S> which you would need for any solution. <S> if you know or figure out the pulses per mile its not hard to do the math to figure out the time between pulses at different speeds and then add the plus or minus accuracy of the clock on the microcontroller to find out what your speed error is. <S> My guess is the analog and timing nature of the sensor and wires are themselves going to have as much error as the clock you are using as a reference. <S> (jitter in the pulses at a fixed rate). <S> You can also throw in slop in the drivetrain, variation in tire sizes (as you peel out, stress the tire with the brake or acellerator, etc) <S> , you are probably fine, I would start with the internal oscillator. <S> Using an external oscillator or the internal one you could have a timer count every second or something like that and count speedo ticks per second and update the display (tubes) based on that (instead of measuring between every speedo tick). <S> The biggest problem I had when I did this was not the sensing or timing of the pulses, I had a heck of a time doing the divide by tens to print the speed in decimal, hex was easy, octal even easier, but decimal when the program space was a kbyte or less and memory was measured in bytes. <S> your avr likely has more resources than I had at the time and a good (and affordable) C compiler. <S> Would love to see pictures when you get it working... <A> Here are some tips: http://winavr.scienceprog.com/example-avr-projects/measuring-motor-speed-and-display-result-on-lcd.html <S> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=642909 <S> As others have said, you don't need a realtime clock unless you care about the date and time, you just need to measure the time between rotations. <A> Thanks, I reviewed the links and i think we can do it without. <S> There is a speedo on the market that in order to calibrate you drive on the highway and hit a calibrate button once for 2 mile markers. <S> this will count how many pulses are in a mile <S> and then we can calculate the speed based on those numbers and use speed buddy's to confirm. <S> Now all i need is some simple transistor and resistor selection and implementation done and i am ready to order. <S> I want to also have hi voltage turn indicators using neon bulbs <S> so i figured i would use 2 resistors the split the turn lamp voltage and then put that through a transistor. <S> I have a bunch of mpsa42 transistors <S> i think will work. <S> ThanksEd <A> I wouldn't trust the onboard RC in an automotive application for measuring speed. <S> Look at the spec for drift over temperature. <S> What temperature extremes do you anticipate where you live or might travel? <S> A simple crystal and two caps will get you an oscillator that is far more accurate than you need. <S> Some have the capacitors built in. <S> Lower cost than crystals usually, <S> though for hobby projects I think that counting pennies is a little silly.
A resonator would probably work well.
What is a 50-ohm antenna? How would you make one? This is an intentionally very open ended question. What does it mean for an antenna to be a 50-ohm antenna at some frequency? How do you make a 50-ohm antenna for say 433.92MHz? What are the options? What are the consequences of it being different from 50-ohms? <Q> What does it mean for an antenna to be a 50-ohm antenna at some frequency? <S> V = IR <A> When referring to RF equipment you have to deal with 'characteristic impedance', which is a property of antennas, feed lines, and even transmitter output stages. <S> The important thing is to make sure that impedances are matched up all the way from the equipment to the antenna. <S> This is more important for transmitters, since more power is involved, but doesn't hurt for receivers either. <S> One thing you don't want to do is just wire together two items with different impedances. <S> There are RF transformers of various kinds can be used to match up sections that otherwise would be mismatched. <S> Any abrupt change in impedance causes RF energy encountering the mismatch to partially reflect, sort of like what happens when light strikes a piece of glass. <S> When one end of the system is a 100W transmitter, this can result in significant energy being reflected back to the tranmitter's output stage. <S> Basically, it's just inefficient, since the reflected energy just becomes waste heat in the transmitter, and the output from the antenna is diminished. <S> The measure of how much reflection is going on is referred to as the standing wave ratio, often abbreviated SWR. <S> Not all RF systems are 50 ohms. <S> There are kinds of coax (e.g. RG-59) that are 75 ohms, and 300 ohm twin lead that are not uncommon. <A> Trying to think what 433 is used for off the top of my head :) <S> Is that the weak signals band? <S> At any rate, most 2-way radios are made to match up to a 50ohm antenna and the matching is left up to you. <S> You can get an antenna that is already tuned, or you can do impedence matching through a number of techniques (see the referenced article below). <S> With a good match, you reduce standing waves. <S> Standing waves build up when the radio sends out a nicely modulated signal but the antenna isn't resonating at that frequency and causes standing waves, which feed right back into the radio and can blow out the final stage. <S> The higher the output power, the more this becomes important. <S> At very low power, say <1watt, the worst you have to worry about is the antenna not resonating and your signal not going anywhere. <S> At higher powers, say 50 <S> + watts, you can damage your transmitter in less than 1 second. <S> Modern radios have built-in SWR detectors that will cut the power if it detects a problem. <S> Those aren't always guaranteed to work though. <S> This page lays out a few key things verey nicely <A> A great tutorial: <S> The Dropout’s Guide to PCB Trace Antenna Design <A> A 1/4 wave antenna with four 1/4 wave radials at 45 degrees will give something close to 50 ohms impedance. <A> It's also useful to understand why a 50-ohm antenna is so important. <S> Let's say you have a source with an output impedance (resistance) of 50 ohms, like the ideal battery/resistor combination in the following diagram: <S> If you want to extract maximum power from the above source, the load resistor you need has to be 50 ohms. <S> Try it yourself - put in 40, 50, and 60 ohms, and <S> calculate how much power goes to the load in each case. <S> So, this is the reason why 50 ohm antennas are important: The sources that drive them typically have 50 ohms of impedance. <S> Therefore, if you want to deliver the most RF power from your 50-ohm source to your antenna - voila, only a 50 ohm antenna will do that! <A> Here's a good app note for making a Bluetooth PCB antenna (2.4Ghz) http://www.national.com/appinfo/cp3000/files/SBK/Bluetooth_Antenna_Design.pdf <A> 50 Ohm is input impedance of feedline to the antenna. <S> In general practice, we connect an antenna with 50 Ohm connector ( like SMA, Coax...) <S> so feedline impedance should be also 50 Ohm. <S> For Bluetooth antenna design at 2.4 GHz, you can also refer https://anilkrpandey.wordpress.com/2017/01/19/inverted-f-bluetooth-antenna-design-for-smart-phone/
It means that if you apply 1 V RMS sine wave of that frequency at the end of the antenna, a 1/50 A RMS current will flow in the antenna at that point.
How can I find a good (local) electrical engineer I'm trying to find a local (nyc) electrical engineer, or electrical engineering company to help me make a small device that involves cell phones and bluetooth - at least I think it will involve bluetooth. My questions are simple: Are there any sites devoted to contract jobs for electrical engineers?How can I find small local EE companies that might be able to help me?How can I best judge the quality of an EE? Thanks! <Q> I don't know of a good site devoted to contract jobs for EEs. <S> You might try talking to folks at NYC Resistor . <S> They're a hacker collective, not an EE company, but they're in Brooklyn and might know local EEs. <S> Adafruit is based in New York. <S> While the customers are from all over the place, you might find more New Yorkers than here. <S> (Chiphacker seems to have a lot of folks from Australia and the UK.) <S> Here are a few examples of folks who could probably do the job (but they're in California) <S> : <S> mindtribe.com <S> 219design.com <S> speckdesign.com <S> d2m-inc.com <S> You might also want to think about whether you have the resources to hire an electrical engineer to work for you. <S> Very few individuals do. <S> The going rate for consulting engineers in New York is probably above $100/hour, and developing a real product takes at least hundreds of hours. <A> All of these questions are hard, actually. <S> As far as judging the quality of an EE when you're not an EE: You will have to be able to communicate well throughout the project, so even if you don't speak that much Electrish, you should try to ask questions in their language. <S> The other way round, EEs who talk so much Electrish that it sounds like they know all <S> and you are dumb, well, they may be bright, but they will not solve your problem. <S> You will have to spend some hours in your first meeting and if you don't even get the least idea about what tricks they are going to use to get your requirements running, you should not sign any contracts. <S> Some side-notes: <S> I'm not from NYC <S> and I don't know about an online list, but for jobs as special as this one, It may be the case that no yellow pages (or the like) are available, no matter if you're from Europe or from NYC. <S> My company often arranges contracts with smaller companies for R&D tasks, and it really is very difficult to find good partners. <S> Often, the less shiny and power-pointy ones are the good ones. <S> Once you found a shop who looks like they might be able to help, prepare some good questions concerning your project and try to ask like you're the employer in a job interview without being impolite. <S> Good contract developers are real treasures. <S> Word of mouth might be the only source towards finding them. <A> LinkedIn would be a place to start. <S> Perhaps a friend of a contact knows one. <A> I'm a good (I hope) <S> electrical engineer local to NYC, but that doesn't mean I know anything about Bluetooth. <S> When judging the quality of the engineer, you need to ask questions related specifically to what you want them to do. <S> There are lots of different sub-fields, and they can be highly specialized. <S> Do you want them to develop Bluetooth hardware, or just interface pre-existing Bluetooth hardware to something else? <S> You might just want to try Craigslist ( Arch / Engineering ). <S> I think you have to pay to put a job ad on there, though. <S> Also there are hardware sections on sites like rentacoder (now called vworker?), which seems appropriate for a single small project. <S> 70 alternatives to rentacoder. <A> adafruit now have a moderated jobs board . <S> Lots of EEs and other people capable of your requirements would most likely have a look there. <S> Even I got a job from it. <A> "Horses for courses"........ <S> Different EEs are better for different types of jobs. <S> It all depends on the project in question I suppose.... <S> For instance I do commission based work for people that have there own in-house EEs - because I have a different skill set that centers around EEing for audio and sound. <S> Also Zebonaut's point about communication is really important - You need to be able to communicate your ideas well, so it helps if you see eye-to-eye with your EE. <A> The answers listed here all sound good. <S> You may need an engineering friend to help you with the recruiting though for filters. <A> Don't limit yourself to only local EE's because it will greatly reduce your choices. <S> I'm an EE that designs electronics (including Bluetooth) for entrepreneurs and small companies around the U.S. and UK. <S> None of my clients are local, nor do they need to be. <S> As others have explained not all EE's are the same and it is a huge field of study. <S> For example, I would bet that very few EE's have experience designing Bluetooth. <S> So be sure to hire one with the exact skills you need.
I recently wrote an article on this very subject that you may find helpful: http://teelengineering.com/contracting-the-right-electrical-engineer-for-your-project You might also ask in the Adafruit forums . Judging from your budget, you may be able to recruit a college student (who's also a hacker) in the subject area that you need expertise in.
How to determine if TV is on by looking at yellow RCA monitor signal? I have a U.S./NTSC LCD HDTV that has a yellow RCA monitor jack on the back. Would it be possible to monitor this connector on an analog input of a microcontroller to determine when the TV is on or off? Unfortunately, I don't have scope that will let me look at the signal from the RCA jack. I think my microcontroller's analog port typically measures from 0 to 5V. Would I need a scaling circuit, resistor, diode, or something other than just hooking a wire directly to the analog input? (Yes, I'm fairly inexperienced on the hardware side, thanks!) What danger do I pose to the TV? <Q> This kind of input can be found on a DMM, an oscilloscope, or an analog input pin on an IC - as long as you do not exceed the maximum voltage of the part. <S> For the Arduino, this means you must be between -0.7 and 5.7V, to avoid turning on the diodes internal to your microcontroller. <S> As soon as you add discrete components between two digital transceivers, though, you risk a lot. <S> Also, make sure that your grounds are the same. <S> 0V <S> according to the TV might be much higher than 0V according to your earth-grounded PC. <S> Put a 100k resistor between the two shields. <S> To answer your first question, though, the output of an NTSC signal in the US is 1V - source <S> this appnote from <S> this page about measuring video signals by Tektronix. <S> You'll see frequent references to units of IRE , which is a unit for measuring composite video signals that (Unlike voltage) is consistent between various formats and countries. <S> 100 IRE is the difference between white and black. <S> An NTSC signal will never exceed 140 IRE, which is 1V, so 1 IRE is approximately 7mV for your signal . <S> If don't trust this random stranger on the Internet (backed by Tektronix, but how credible are they?) <S> , you can connect your DMM instead of your Arduino, which should read the RMS (Root mean squared) value of what it supposes to be a DC input signal, and should be quite safe up to higher voltages than you want to get near enough to measure (600V?). <S> The AC amplitude likely won't work, as it's optimized for 60Hz household wiring, but check your manual. <A> Usually TVs are pretty good about protecting outputs like these. <S> Manufactures know that people will accidentally short them and/or hook them up wrong. <S> I would just be sure to not apply any voltage to the port. <S> In the simplest form, you will probably find that there is no voltage on the line when the TV is off and some voltage when the TV is on. <S> If you have a DMM, you can check to see if you observe this. <S> Check with the DMM on both the DC mode and AC mode. <A> The yellow RCA jack should output standard NTSC signals, if it is an Output. <S> The yellow RCA input should be a high-impedance input, so the level on that won't tell you much about the status of the TV. <S> On the output jack, NTSC voltage levels vary between 0V and 1.0V practically--some TVs vary on high-white output. <S> The easiest way would be to check for the line going low for 4.7uS or the horizontal sync pulse. <S> You could also check for the vertical syncs, but many TVs disagree on the standard for that too. <S> The problem with measuring it on a DC meter is the AC nature of the signal, and an AC meter will just average the entire signal. <S> You might be able to experiment with it a little bit.
First, I'll answer your question about danger to your TV: As long as you connect only high impedance test leads, you pose very little danger to your TV or anything else you want to measure. Test this with a DMM beforehand, measuring between the shield of a USB cable to the shield of the RCA connector. Anything more than a couple volts on this measurement, and you've got trouble. If the TV is on, the output for video should show 4.7uS h-sync pules, and then color-burst/blanking and then pixel data after that.
What's the easiest/cheapest variable-frequency sine wave oscillator? A Google search will give you a few billion ideas. Which is the simplest/easiest/cheapest that you know of? Generating a square wave and then filtering out the harmonics isn't a good solution unless the filter frequency can be varied along with the square. <Q> Wien bridge with a pot to vary the frequency. <S> I bet you could build one for less than one US dollar. <A> Making a numerically controlled oscillator (NCO) with uC + DAC is very easy. <S> Could be a fun FPGA project. <S> An advantage to an NCO is that you change waveforms. <S> I did a low frequency numerically controller oscillator Arduino sketch (see http://wiblocks.com/docs/app-notes/nb1a-nco.html ). <S> At thebottom of the webpage are a couple of references to the originalarticles, <A> You didn't specify the frequency (100Hz or 100MHz?) <S> or how much the frequency had to be varied (0.01% or 1000% ?) <S> or whether the frequency had to be varied by a voltage or a physical knob. <S> Purity of sine wave and stability matters too. <A> You could also PWM or otherwise DAC values out of a table to produce sine waves. <S> Then the filtering should be easier. <S> A very cheap MCU could probably do it up to fair frequencies. <S> I might second some RC + opamp design in principle. <S> Whether the output and adjustability suits you depends on the application. <S> There are also some function generator IC's, ranging from classic 8038 to various complex DDS thingies. <S> They might not come that cheap, though. <S> I guess there's also the option of finding an affordable second hand lab signal/function generator. <S> It might be a long search for a cheap one, but it's all relative. <S> Or you could take a spare AC generator and turn the shaft with variable speed. <S> Amplify for power/impedance/voltage :) <A> Cheapest DIY DDS signal generators (including sine wave): http://www.myplace.nu/avr/minidds/index.htm http://www.scienceprog.com/avr-dds-signal-generator-v20 <A> You can still do it with a square wave and filtering out the harmonics. <S> There are a number of high order filters that can be controlled with a microcontroller easily. <S> This one allows the user to control the corner frequency with an outside clock (second square wave from the micro). <S> Because of the large corner frequency to clock frequency ratio you could even do it without the need of another timer/interrupt with a simple software counter... <A> If you want to go the direct digital synthesis route with discrete chips, capacitors, etc. <S> the result won't be nearly as compact as what could be done with a CPLD or micro, but would be pretty reasonable, especially since a significant amount of the circuitry could be shared among the five signal outputs. <S> Global signal generation requirement: Input clock source 12-bit counter (74HC4040) <S> 14 inverters (3 of 74HC14, leaving 4 gates open) 13 small-signal capacitors 13 resistors <S> Per-output requirement: 13-input NAND gate (74HC133) 12-bit counter (MC14521 or CD4521) <S> Lots of jumpers to set frequency <S> More details to follow. <S> Given an input of 4,096,000Hz, the circuit should be able to produce square-wave outputs from 2KHz to 512Khz in multiples of 0.5Hz for signals up to 2KHz, 1Hz for signals up to 4Khz, etc. <S> Other techniques can be used to convert a square wave thus generated into a sine wave. <S> Here's a circuit diagram to show the concept: (HERE) <S> This circuit includes a configurable frequency generator (5 switches select input frequencies from 1/16 of the input up to 31/16 of the input). <S> I also threw on a rough square-to-sine converter. <S> Note that unlike most filtering techniques, this one maintains a reasonably consistent amplitude over the frequency range. <S> The wave is quite rough because the above circuit only uses 4-bit counters. <S> The MOSFETs would be replaced in practice by 4066 pass-gates (4 per chip). <A> Triangle oscillator with a triangle to sine converter .
A one-transistor FET Hartley oscillator is hard to beat for cheap.
PWM above 16v for speed control? Will it work? I have recently ordered 1 x VNH3SP30 Motor Driver Carrier MD01B I was just reading the charts and found below saying about the pwm, VNH3SP30 and VNH2SP30 Comparison: VNH3SP30 VNH2SP30Operating supply voltage (Vcc) 5.5 - 36 V* 5.5 - 16 VMaximum current rating 30 A 30 AMOSFET on-resistance (per leg) 34 mΩ 19 mΩMaximum PWM frequency 10 kHz 20 kHzCurrent sense none approximately 0.13 V/AOver-voltage shutoff 36 V* 16 V minimum (19 V typical)Time to overheat at 20 A** 8 seconds 35 secondsTime to overheat at 15 A** 30 seconds 150 secondsCurrent for infinite run time** 9 A 14 A * Manufacturer specification. In our experience, shoot-through currents make PWM operation impractical above 16 V. ** Typical results using Pololu motor driver carrier with 100% duty cycle at room temperature. Does this mean if I want to PWM (vary the speed) of 24v actuators under load, will this work correctly with this VNH3SP30 board? or will it 'jump' voltage and not work How/What would you recommend please? Thanks in advance,Galen <Q> Shoot-through current refers to the condition where both switches/MOSFETs on one side of the H-Bridge are on simultaneously. <S> Under normal conditions, the H-bridge is under one of the following conditions: If, however, both switches on one side are on simultaneously, a huge current can flow (Only 34mΩ per leg, remember?), which is usually destructive. <S> I'm not sure why both switches would be on - Possibly an issue with gate capacitance and switching time? <S> The datasheet says that the PWM pin is: Voltage controlled input pin with hysteresis, CMOS compatible. <S> You might get better luck with higher voltages if you modulated the PWM such that it was centered on the ON-pulses: <S> Motor on: <S> ---- <S> ---- <S> -- <S> --S <S> -Left-Top__/------\________/------\________ S-Rght-Bot___/----\___________/--\__________S <S> -Rght-Top__________/------\________/------\S <S> -Left-Bot___________/----\___________/--\__ <S> But you'll definitely want to look very carefully at Figures 4, 5, and 6 of that datasheet. <A> Is it possible that the author of this data sheet meant to say "flyback current" rather than "shootthrough current"? <S> During the "on" time of the PWM, two transistors are on and getting warm: current flows from the battery through one high-side transistor through the motor through one low-side transistor to ground. <S> During the dead band, the other two transistors have current flowing through them and getting warm, even though all four transistors are turned off. <S> The parasitic inductance of the motor causes current to flow from ground through the internal protection diode of one low-side transistor through the motor through the internal protection diode of one high-side transistor to the battery. <S> So that parasitic inductance indirectly causes the voltage across each of the original two transistors (that were recently turned off) to be a significantly higher voltage than the battery voltage. <S> The voltage blocking rating of a transistor applies to the actual voltage across the pins of the transistor (which during flyback is significantly more than the battery voltage).So to keep the transistor within its rating -- i.e., in order to keep the transistor from self-destructing -- the battery voltage much be significantly less than the transistor rating. <S> Alas, practically all motor controller driver manufacturers simply copy the voltage blocking rating of a transistor directly to their advertisement. <S> It's used as a marketing number because it sounds bigger and more impressive than the actual battery voltage you can actually use with it. <A> If you have total control of the four transistors comprising the H-bridge, you can mitigate against shoot-through by leaving a dead-band in the control signals. <S> What this means is, for both sides of the bridge, before you turn a high-side driver ON, you turn the low-side driver OFF and allow a small amount of time to elapse. <S> Same goes for turning off the high side and turning on the low side. <S> The reason you would do this is that turn-on and turn-off times are asymmetric. <S> Usually it takes a device a little longer to turn off than to turn on. <S> If you try to simultaneously change a side of the bridge from high drive to low drive (or the other way), there will be a brief interval of time during which both devices will be partially conducting, and this allows large currents to flow directly between the supply rails, heating the transistors in the process. <S> For efficiency and longer component lifetimes, you want to keep only one transistor on a side fully conducting, the other completely not. <S> The effect is exacerbated by higher voltages by ohm's law; more voltage means more current, and the heating in the transistors is consequently worse. <S> The effect is also made worse by higher switching frequencies. <S> Every time the polarity is reversed, a little burst of shoot-through current occurs. <S> At a few hundred Hz and under 12V it's not worth worrying about too much. <S> An industrial controller working at 300+ bus volts and 10+ kHz pwm definitely has a concern. <S> Fwiw, dead band times of 1 to 2 microseconds suffice to ensure that shoot through doesn't occur.
Gates of low side FETs are modulated by the PWM signal during their ON phase allowing speed control of the motor.
Memory suggestions for MSP430 I'm developing a measurement application with the TI MSP430 and I would like to hear some suggestions on what type of memory I can use. The idea is to use it for logging during a certain time and then download the data to a PC when the device is connected via USB. The estimate is to hold up to 5MB of data, every sample being around 25 bytes of data. Would a simple EEPROM chip do or is there something better out there? <Q> They have an internal SRAM buffer to setup a page for erase/programming. <S> SPI interface to read data in and out. <A> 5MByte is a lot of data to store. <S> Reading it out over USB implies that you are using one of the new parts with the USB device interface built in. <S> If not then you are going to be using a USB to serial converter (FTDI or similar) and will be limited to the async serial data rates for reading the data out. <S> Have you considered connecting an SD memory card to the MSP, storing the data in that and then moving the card to the pc for reading the stored data. <S> I have not written an interface to this device <S> but there are plenty that have. <A> Serial flash is superior to EEPROM in this application. <S> Atmel makes a great lineup . <S> Your choice will depend largely on two things: (1) <S> Your need <S> to edit/sector your logs on the micro and (2) <S> Your RAM availability on the MSP430. <S> Flash, unlike EEPROM, can only be written from a 1 to a 0. <S> Changing the data from 0 to 1 requires erasing a section of the part, which is typically only available for pages or blocks of data. <S> You'll need to buffer this page into RAM, erase the page, make your edit in RAM, and then write it back if you want to change something. <S> The AT45D series, as has been already pointed out, offers a number of parts which have RAM buffers on the chip to facilitate this process without using RAM on the microcontroller. <S> In the end, the entire series is pin-compatible, so just put down an 8-SOIC (150mil) footprint, and then you can swap out the parts if you need different options later. <A> I would suggest the AT25D series since it appears a little easier to use than the AT45D. <S> Although it's a little slower and does not offer as many data transfer options or the SRAM buffers. <S> It does have the advantage of being less expensive and it is still quick enough for most applications like data logging. <S> If you need 5MB of data it's unlikely that an EEPROM will work since they come in < 1Mbit packages typically. <A> [This is in response to the comments following Ian's answer]. <S> An SD card is just an SPI device, so there's no chip/interface necessary. <S> Other protocols include a 2-wire interface (like I2C) and a 4-wire interface (with a complex CRC), but SPI is the most commonly used. <S> There is an SD card application note available for the MSP430 from TI here <S> .It's brief, but it includes sample code. <S> It handles reading and writing to various sectors on the SD card, which may be all you want if you're not going to plug it into a PC. <S> Also look at these implementations by Foust (recommended) or Evans from MSU. <S> Once you have the basic functions to read and write a sector, you can either abstract a simple, custom filesystem over USB, or use an existing filesystem library. <S> FatFS , EFSL , or DOSFs are all options for the latter. <S> If implementing all of the required functions seems too hard, remember that all but a few can/will be stubs. <S> However, the file system will be abstracted through your USB interface to a degree. <S> This will be easier if you have a real filesystem library and your card is in a readable filesystem, but that takes work. <S> If you want to write your own "Filesystem" and save work/time/memory for the USB implementation, you can make its definition as simple and inflexible as log 1 starts at 0x0, log 2 starts at 0x10 0000, log 3 at 0x20 0000, and log 4 at 0x30 0000. <S> Then, you can send this data over USB. <S> The USB interface can be as complex as you like it to be - from serial interface to mass storage device.
I've used the AT45D series of serial flash chips. Flash chips from Atmel support up to 64-mbit or 8MB.
4x8 LED Scrolling Display with Arduino So I am wanting to make a custom LED scrolling message display. Basically I have a surface I am going to mount 32 LED's to and then have them controlled by an Arduino. What kind of hardware would I need and what would you suggest for a power source, I want to go as light and compact as possible. <Q> I guess it depends on the rating of your LEDS a bit - <S> But you will need to look at expanding the Arduinos digital outputs by using some latching Shift Registers. <S> Once you've worked out what rating LEDs your using you can get a better idea of what power source would be the best. <S> If your just using standard LEDs (around 20mA) <S> it's <S> life span will be. <S> and it'll last around 30 hours of solid LED scrolling fun! <S> Here's a video showing my matrix if you're interested. <A> Here's a similar project on Hackaday. <A> You could also use a Maxim MAX7219 , could save some PCB space with it. <A> I'm working on a similar project for an R2D2 build with Arduino. <S> I've gone through the following project progression so far: <S> Wire eight LEDs (directly) up to Arduino with a breadboard, make them blink randomly. <S> Not too difficult. <S> Charlieplex six LEDs with three lines via Arduino, make them blink randomly. <S> A little more difficult, but not too bad. <S> My next project is designing (on paper) the Charlieplexing circuit for the 8x5 LED array. <S> This will require seven lines, though I will probably use eight to simplify the wiring. <S> My plan is to wire all this to the Arduino board with an eight pin ribbon cable, making everything all nice and tidy. <S> I hope all of this helps... <S> if I understand you correctly, the only thing that would be different between our two projects would be software. <S> As far as power, I'm pretty sure that Arduino should be able to drive that many LEDs without too much trouble. <S> Ultimately I'll be relying on Li batteries, but in the meantime, I just use the 5v from the adapter. <S> 08-13-2010 <S> - I just found this . <S> It looks like both of our projects are subsets of this one. <S> I bought one, and I expect that the wiring on the board will give me the education I need. <A> I did this project with 10mm LEDs in a 2 inch grid in a wood frame. <S> I used an ATtiny2313 to drive the cathodes of 8 LEDs at one time, four transistors switch between the columns of anodes, and the chip runs off its internal oscillator at 8MHz. <S> A MAX2313 drives the serial port. <S> A special 4-pixel wide font fits on this very low resolution display. <S> An attached computer sends 32-byte frames (8 bits of brightness per LED) over a serial port. <S> Scrolling text at this resolution and size was rather unsatisfying so <S> instead I flash each letter of the message. <S> The code is available on Google Code .
there's no reason you couldn't power the whole lot from a 9v PP3 battery, you could even use a smaller equivalent 9v battery to get the size and weight down - but the smaller you get the less I use an Arduino, 3 x 595 Shift Register and one of these Bi-colour Red Green LED matrix - the whole lot is powered by a PP3 9v battery
Make a momentary switch control a toggle What are the simplest, cheapest, smallest ways to make a momentary switch produce a 2-state toggling output (latching momentary switch)? In other words, the output is continuously low, and when you momentarily press the button/tact switch, the output changes to continuously high, and then when you press it again, it switches back to low. <Q> Here's another alternative with two inverters and debouncing: For logic output, only the two inverters, RC, and feedback resistor are needed: NC7WZ14 <S> is $0.06 with 2 inverters, small 6-pin package, and Schmitt trigger inputs, though I think this circuit doesn't even need Schmitt inputs because of the RC. <S> Also it can drive 24 mA, so you could connect the LED directly to it if you're using an LED for whatever reason. <S> Also shown here and here as a toggle touch switch . <S> I think the feedback resistor has to be much smaller than the center resistor to prevent it from oscillating if you hold down the button, because the low-impedance connection to the output will prevent the capacitor from charging to the middle voltage until you let go. <S> Variants are described at Press ON - Press OFF soft latching circuits : <A> One possible method: Use an RC to debounce the switch and then feed it into a D flip-flop with the output feeding back to the input to implement a T flip flop. <S> The D flip-flop needs to be positive edge-triggered only, and needs an inverted output. <S> The 8-pin <S> NC7SZ74 should work, is very small, and costs $0.12 in quantity. <S> The 74HC74 is a dual D flip-flop with 14 pins for $0.05. <S> Are there any issues with this? <S> The switch would need to be held down for a short period of time for the rise time to trigger the clock input, which is probably good. <S> If you hold down the button, it will only trigger once, which is good. <S> Is there a better way to debounce in the feedback loop or something instead? <A> Or you could do it with a single tiny 6-pin microcontroller and no other components. <S> It might cost a tiny bit more, but it's simpler and takes up less space. <S> Debouncing a switch in software is simple, then it's just a manner of storing a boolean if the output should be high or low. <S> The smallest version of this mcu comes in a 2mm x 2mm surface mount package. <S> In large quantities it might be $0.50. <A> If transistors are like $0.02 in large quantities, it would be maybe $0.10 total? <A> Make a T flip-Flop by shorting the inputs of a positive edge-triggered j-k flipflop and connect the pushbutton output to the clock input of j-k flip flop. <S> simulate this circuit – <S> Schematic created using CircuitLab <A> Could you not just do it in software? <S> Will the button be an input on a programmable device, or do you need to do the toggle in the hardware realm? <S> boolean buttonState = false; // store for toggle state, false = off true = <S> onif(yourButton = <S> = HIGH && buttonState == false) // <S> if button is pressed and toggled off{ Serial.println("Button Toggled On"); // do something while button is on buttonState = true // set button state to on}if(yourButton <S> == HIGH && buttonState == <S> true) // <S> if button is pressed and toggled on{ Serial.println("Button Toggled Off"); // do something else while button is off buttonState = <S> false // set button state to off} <S> Sorry <S> if this is off the mark, obviously this answer depends on you using an MCU or programmable chip. <A> I know it's kinda an "indirect" way of doing it, but you can get a hall effect sensor like sparkfun has: <S> http://www.sparkfun.com/commerce/product_info.php?products_id=9312 and just use a magnet <S> , I found out (the hard way) that this particular hall effect is latching, so it won't work for what I need it to, but looks like it could in theory work for what you're looking for. <S> I just plugged it into a breadboard, I think I may have used a resistor (It's been probably a month <S> so I'm a little fuzzy on the details), and when I move the magnet close (momentary) <S> it closes the sensor and there you go. <A> The easiest alternative is to use an alternating pushbutton switch. <S> If you ignore the fact that it latches at different positions, it's almost exactly like a momentary switch. <S> I understand that this isn't the spirit of the question, but it is a simple and compact solution requiring no software and no external hardware. <A> Not sure exactly what the end goal is <S> but I thought I'd put this out there: <S> This is a great little circuit I like to use to drive bistable relays. <S> It's pretty cheap to build as well. <S> Pressing the momentary switch toggles the state of the relay and the LED. <S> It's not really picky about how long you hold down the button. <S> Since the relay is latching, it won't draw much current most of the time. <S> In this configuration, the LED will turn on when the relay is in its set condition and off when the relay is reset. <S> You can also connect R7 to the + terminal of C3 to make the LED turn on when the relay is reset instead. <S> I like to use this in guitar effects so I can bypass or engage the device with a momentary footswitch. <S> Of course a 3PDT switch would do the same thing on its own, but the switching is quieter this way (no big pop) and momentary soft-touch footswitches feel much nicer than the big 3PDT ones. <S> Hope this helps.
By storing a button state in memory it's quite easy to use a momentary switch as a toggle. This circuit (also described here ) is very cheap, but is more complex and takes up some space with all the components.
Are there any powerful processors that exist that are hobbyist friendly? Ok so I have a project I am wanting to create but it would require a bit of processing power. The most powerful thing I've seen yet has been the ATMega1284P . Really by power I mean I need Program Memory and RAM, not raw MIPs. Is there anything else out there that is hobbyist friendly? By hobbyist friendly I mean not having to have any expensive machines to solder it (rework stations etc). Also of course being capable of buying just a couple of them without spending an arm and a leg. And of course having freely available compilers and other software tools. My project is to build a small (portable) calculator with simple graphing capabilities and possibly some limited programming capabilities. <Q> Low-cost ARM boards like the LPCXpresso and mbed are easy to use, and will give you a lot more performance. <A> Take a look at something in the OMAP family. <S> Gumstix ? <S> Beagleboard ? <A> Depending on the specifics of your project, I might suggest the NSLU2 <S> "Slug" which is an ARM processor, clocking in at 133 or 266 Mhz. <S> That gives you a very small (embedded) board and some USB ports and even one or two serial ports (UART plus MAX232). <S> You could write your app to run in Linux, compile it with GCC, etc. <A> Parallax Propeller. <S> 8-32 bit parallel cores and built in VGA support. <S> It would be very easy to build a programmable graphing calculator using this processor. <S> The chip is in 40 pin DIP configuration and there are a number of prototyping boards available, several of which have video, keyboard and mouse support hardware built in. <A> Many processors/microcontrollers support external memory. <S> For instance, the AVR XMega can support several MiB of external SDRAM for data storage (can't execute from the external bus). <S> (There is a GCC limitation of 16bit pointers for AVR-GCC). <S> Many ARMs have external buses as well: LPC2478, Luminary parts, AT91SAM series. <A> Cool project! <S> I suppose that your choice of processor (and reason for needing external memory) will depend on how you define "simple graphing capabilities" and "limited programming ability". <S> Stop and consider that the TI-83 calculator has a 6 MHz processor, uses 8KB of RAM for system functions (24KB is free for user programs), and has 512KB of Flash with an external 2MB Flash chip on the special "Silver" editions. <S> It runs a proprietary OS, and has support for more mathematical functions than I've ever heard of or used, as well as programming in 4 languages. <S> Your ATMega1284 has 16KB of RAM and 128KB of Flash. <S> Do you think you're going to generate enough code to fill those 128KB, given that TI only used about three times that much? <S> I doubt it. <S> If you just want to use a character LCD and a LED array for graphing with basic math functions ( <S> Buttons 0-9, variables x and y, +-*/%=, and some kind of storage), then an ATMega or Arduino is more than adequate for your needs. <S> If, on the other hand, you want to run a color TFT with embedded Linux, scripting/programming in bash, lua, or whatever programming language you choose, graph with gnuplot, and enter everything on a mini querty keyboard/numpad, then you should look at more powerful chip. <S> Definitely go for 32-bit if you want to deal with big numbers, and if you want to address lots of memory. <S> Most of these chips (I recommend ARM) come in QFP packages - But don't be afraid! <S> You don't need expensive machines to solder a [LT]QFP or PLCC device - Just a steady hand, a fine tip, and decent technique will be adequate. <S> Oh, and a well-made board with soldermask. <S> However, many dev boards will be well suited to this project. <S> You can buy these chips in singles for $2 to $15, depending on the options you want. <S> Also, many manufacturers will send samples if you just ask, in hopes that you'll buy thousands once everyone is taking the ACT and SAT on an EARLZ-9000 calculator! <A> You've received a ton of great information on microcontrollers, but if you want to simplify your job on the display end, you might want to take a look at some LCDs that make designing GUI and displaying graphics easy. <S> Although I haven't used its graph functions before, I have used Amulet Technologies' LCDs (both monochrome and color) and have been very pleased with how easy it is to use in combination with a little microcontroller. <S> You just have to implement its RS232 serial protocol, which is pretty simple. <A> Depends on your definition of "powerful" of course. <S> 32-bit processors are everywhere and come in relatively easy to use packages (leaded PQFP, etc.) <S> What are you trying to do? <A> Bifferboard? <S> http://sites.google.com/site/bifferboard/ <S> * 150MHz CPU, Intel 486SX instruction set, MMU. <S> * 1 watt power consumption (200mA @5v) <S> * 68mm x 28mm x 21mm (weight 28g) <S> * 32MB SDRAM/8 <S> MB Flash <S> * OHCI/EHCI USB 2.0 <S> * 10/100 ethernet <S> * Serial console 115200 baud (can be used as 2 GPIO) <S> * 4-pin JTAG (can be used as GPIO) <S> * 2 permanent GPIO (1 LED, 1 button) <S> * Linux 2.6.32.16 <S> * Supplied pre-flashed <S> with OpenWrt * <S> 35 GBP each
Personally I have seen the Propeller processors do some incredible things, and I am partial to most ARM variants, although again, the definition of "powerful" needs to be evaluated. :-)
hardware for pushing buttons Many times I want my computer to interface old hardware. Such as radio, light switch, etc. This mostly involves pushing pressing and moving various buttons and switches. I don't want to buy new hardware I want my computer to interface the old hardware I already have. I thought about it and reached to the conclusion that what I need is a general purpose button-pusher hardware. I need a simple device I can interface by a computer and would be able to push most of the buttons we have in daily accessories, without damaging the button. Is there any such accessory availible? (migrated from superuser, where I got no satisfactory answers). <Q> Are you completely opposed to making minor modifications to those old devices? <S> If not, you can probably interface with them by means of placing relays in the circuits the buttons and switches control. <A> First off is the humble solenoid - basically a coil-gun where the slug can't leave the coil. <S> They can exert a lot of force, but can't be controlled in terms of speed and give a nice "whack" sound. <S> A servo with a rocker arm would work (mechanically more complex). <S> Its capability of pushing buttons would be slower, but more controlled. <S> A stepper motor or a free-running servo could accomplish rotary dials. <S> A linear actuator (stepper motor on a screw-shaft) could accomplish sliding actions. <S> The most custom portion would be the mechanical interface. <S> I suggest hunting around http://smallparts.com <S> and http://mcmaster.com <S> You could probably find ready-made interface electronics (motor controllers over USB even) at Pololu: <S> http://www.pololu.com/ <A> Old thread <S> but... <S> I'm considering something like this myself. <S> Either with phidgets (phidgets.com) an actuator:3541_0 <S> Linear Actuator L12-50-100-06-R <S> 1066_0 <S> PhidgetAdvancedServo 1-Motor or with Gadgeteer with a relay: <S> http://channel9.msdn.com/coding4fun/blog/Shining-a-light-on-a-Windows-Phone-Net-Gadgeteer-Light-Switch <S> Both are a bit overkill for pushing a coffee brewer switch :D <A> This is an interesting problem. <S> I haven't ever done anything like this, but I too have pondered actuators for physical components. <S> For button pushing, I would probably go with pneumatic (air-powered) actuators; you can easily control the amount of force and you can find them in a wide variety of sizes. <S> Control would be done through solenoid-controlled valves, and all you need is a source of clean and dry compressed air, which is almost never an issue. <S> Switch flipping is more difficult. <S> My first solution would be to have some kind of a mechanical converter to convert the linear motion of a pair of pneumatic actuators to more of a diagonal motion that switches use, but you'd quickly run into physical size issues. <S> A tiny stepper motor with a similar rotary-to-linear interface over the switch would work and be smaller. <S> There is a surplus place close to me that had a huge pile of these style of actuators. <S> Now I want to go buy some and play. :-) <A> Using analogue switches across the actual switches, controlled by a computer or MCU, is a popular technique, and avoids messing about with mechanical actuators. <S> The 74HC4066 is a typical device that can be used. <A> You can find many very cheap USB DIY projects that could be used to interface your old equipment here: http://www.obdev.at/products/vusb/prjhid.html . <A> Interesting problem. <S> I am assuming that the types of buttons/switches you would want to push/move in will have a variety of 'resistances'. <S> By resistances I mean that you may need a small nudge for one button but a forceful whack for another. <S> Also, this may ask for a configurable position (horizontal + vertical) of your actuator that does the actual work of pushing or moving on the accessory. <S> Though, I've personally never tried this, I think a mini servo motor that gives a fine grained degree of control in its movement can be used (similar to Andrew's answer in this thread). <S> The servo motor in turn can be connected to your actuator through a spring loaded trigger mechanism. <S> The spring tension will vary as per the 'resistance' of the button or switch. <S> This whole mechanism in turn should sit on a platform that itself is movable horizontally and vertically (a set of couple of mini servo motors again). <S> Admittedly, my option looks elaborate <S> but I feel if it is designed well, it has endless applicability on all kinds of accessories and may be cheaper than custom devices. <S> The platform can be omitted initially to make it even cheaper. <A> Interface to Lego Mindstorms, build fake fingers with the rubber-tip part, have Mindstorms motor press the button. <S> I did this once. <S> Alternatively, use a Microcontroller to interface to RC servos. <A> For some applications, this might be an easier solution, a relay controlling mains power. <S> http://www.adafruit.com/index.php?main_page=product_info&cPath=44&products_id=268
Stepper motors would also work very well for controlling anything that had to be turned (tuning wheels, volume knobs, etc.) You could use a variety of actuation devices.
Use of tristates vs multiplexers in a RAM Why are tristates favored over multiplexers to select the output from RAM? The explanation that I've heard of is that the RAM is too large for using a multiplexer but I need more details. A theory we've come up with is that using a multiplexer would necessitate a tree of OR-gates to select the output which would dramatically increase the propagation time of the signal to the bus whereas with tristates, no matter the size of the RAM, the propagation delay would be constant. Is that correct? Thanks <Q> It's an issue of "fan-out" or "fan-in". <S> So your theory is more or less accurate. <S> However there is the additional benefit of using tristate outputs that you can attach them to a bus! <A> If one builds a rectangular memory array which is read using a tri-state driver in each memory cell, then one decoder circuit can control all of the cells in a row. <S> One will need circuitry around the perimeter of the array to control it, but the amount of control circuitry will be proportional to sqrt(N)*lg(N). <S> By contrast, if one tried to feed all the memory cells into a multiplexer, one would end up needing a lot more circuitry. <S> The multiplexer-based approach does have some advantages. <S> If one built a one mega-word memory using two-way multiplexers, each bit would have to pass through 20 multiplexers, but one could achieve a very high-bandwidth pipelined memory system if each multiplexer included a latch. <S> It would take 20 cycles to perform any particular read operation, but in 100 cycles one could begin 100 different reads. <S> Since the signal wouldn't have to go very far in each cycle and wouldn't be driving any large buses, the cycle rate could be extremely high. <S> The issue of whether to use multiplexers or buses ends up being somewhat similar to the question of whether to use data repeaters when sending information over long distances. <S> On the one hand, data repeaters add delay. <S> On the other hand, the time required for a signal transition at one end of a stretch of copper to cause a transition at the other end is asymptotically proportional to the square of the length (since adding length adds both resistance and capacitance). <S> Adding a repeater in the middle of a long wire may end up improving speed since the long run will be replaced by two shorter ones with somewhere between a quarter and half of the longer delay. <S> If one were to double the width and length of a memory array without improving the 'oomph' of the row and column driver circuits, one would more than double the time required to switch the rows and columns. <S> By contrast, if one were to use four smaller memory arrays and multiplex the outputs, one would only add a constant to the access time. <S> Faster memories are subdivided into more small arrays connected by multiplexers; cheaper memories use fewer multiplexers but aren't as fast. <A> By tri-stating onto a bus, your system scales better. <S> You can just add more tristatable devices, without having to reconfigure both the old devices and the new device to cooperate through a new and larger multiplexer.
If you use a CMOS Multiplexer you cannot share the wires that the output is on, if you use Tri-State devices then you can share the bus with other bussed devices (under the control of an arbiter for example)... in the context of RAM, think "memory bus."
Advice for USB Sniffer I am looking for a USB protocol analyzer and was wondering if anyone had any experience with one. So far, I am looking at an Internal Test Instruments and a Beagle USB 12 . I only need to watch the full speed (12 Mbs). I need some low-level protocol information so I'm looking at hardware solutions. Any input is greatly appreciated. <Q> I have been using the Beagle USB 12 over the last year or so and have not run into any problems. <S> It has been very useful in debugging some protocol problems I was having with an embedded USB chip. <A> Have you considered doing it in software? <S> Run something on your PC to watch the USB traffic at that level, instead of trying to intercept the actual USB lines in hardware. <S> There are several ways of doing this. <S> However the software might not be as nice as your link, since it's more general purpose, and not specifically for USB. <A> I know you said you were looking for hardware, but cost-wise <S> it makes a lot of sense to look at software: <S> Usblyzer is pretty sophisticated and has a nice interface- <S> also a free demo <S> usbsnoopypro is free and open source, though not quite as user friendly <S> If you REALLY have to have hardware, go with the big boys: ellisys ( reviews ) <A> VMWare can dump all USB traffic to the VM to a giant text-file. <S> They also have a nice GUI tool for analysing the resulting USB log. <S> I like it because I can do everything on windows. <S> It does not require a linux-host, like every other software-USB-sniffer I looked at. <S> If you are ok with linux, I believe Wireshark <S> can capture usb .
If you absolutely need hardware, consider the ZeroPlus LogicCube , it's cheaper, and supports decoding USB 1.1.
Is Arduino suitable to be a Humanoid Robot controller? I am not a Arduino developer here. However I would like to ask if any developer out there who have experience on the capability of Arduino, is Arduino suitable to develop a humanoid robot? Humanoid robot consists of visual camera, sensors and servos, wireless transceiver, compass, accelerometer and so on. Correct me if I mentioned anything wrongly. <Q> The Arduino Duemilanove only has 14 digital <S> I/Os and six analogue inputs, and 2k SRAM maximum. <S> It doesn't look like it could handle all those peripherals without port expansion, and it hasn't got nearly enough memory for image processing. <A> An Arduino on it's own has too little I <S> /O and too little CPU power and memory. <S> You could use multiple Arduinos (as suggested by vicatu) or use something more powerful such as the mbed (as suggested by Joby Taffey). <S> I would suggest a hybrid of both ideas. <S> Use a powerful processor to provide AI and overall control and use simpler microcontrollers as I/O managers. <S> In fact I would suggest a complete hierarchy with as many layers as required with more powerful processors as you rise up through the hierarchy. <S> For example I have used the Gameboy Advance as the 'brains'of a robot while the I/O was managed by PIC16F84 microcontrollers. <S> I think an ideal arrangement would be somthing as powerful as a PC (maybe a mini ITX board) or somthing like a Beagle board as the brains, a middle layer with multiple MBEDs or Zilog Z8s as sub-system managers (motion control, sensor management, some sensor preprocessing etc). <S> and lots of small/cheap microcontrollers (Atmel/PIC/TI MSP430 etc) to manage the leg work. <S> The upper layer can use ethernet ot USB, the lower lesvels can use RS232, I2C etc. <S> An advantage of this whole approach is the you can modularise your development (good for groups of friends or students). <S> Individual modules can have better defined goals (and easier to achieve) and be complete projects in them selves. <S> At higher levels you can concentrate on AI and overall robot control without having to worry about low level details (for example, if you can issue a command to turn the robot 45 degrees you have effectivly divided your problem in half. <S> The higher level can concentrate on decisions on which way to turn (decision making) while a lower level controller just has to satifsy simple well defined motor comnmands from above. <S> In a way this is modeling our robot on the way our brains work (not at a neurological level). <S> When we decide to reach out and pick up a cup we dont have to conciously think about the mechanics of what we are doing. <S> We could see this action as occuring at three levels: 1) <S> High level - the decison to pick up the cup.2) <S> Mid level - co-ordinate motor actions and basic analysis of senory inputs.3) Low level - perform motor action, collect sensor data. <S> Hope <S> this is helpful. <A> Perhaps an mbed <S> (ARM Cortex-M3 based). <S> Although, even it may not have enough lines to control all those peripherals. <A> Like Tim Ring suggested, combining an Arduino with a more powerful device would be your best bet. <S> Using a cheap Netbook as the brains would give you that additional power, you could even use the built in webcam as the camera, and do all of your image processing on the Netbook. <S> The Arduino would plug into a USB port on the netbook and could easily send and receive commands over a serial port - this way you could program all of your IO code into the Arduino and write your higher level "brain" code to run on the Netbook. <S> For example, the Netbook could then issue commands like "Drive Forward <S> For 2 Seconds" to the Arduino and the Arduino could control the motors to perform the task. <S> You could ask it for the reading from the compass or GPS and the Arduino could send the value back. <S> You could also have your "brain" code monitoring the serial port for any data the Arduino wanted to send, for example, if it was driving forwards and a bumper sensor detected a collision, it could send a "Collision" command to the brain and the brain could decide what to do about it. <S> The huge benefit of using a Netbook would be the ability to display diagnostic and debug information on it's LCD. <S> Coming from a PC prgramming background, I find debugging an Arduino with no visual feedback to be very tricky indeed. <S> The Arduino would get it's power from the Netbook too, meaning you only needed to supply a separate power source for the motors/servos. <A> Maybe an Arduino plus a whole bunch of Shields, or multiple Arduinos and multiple Shields communicating with one another (wirelessly or otherwise...). <S> Anything is possible :) <A> Consider an ESMini <S> module in conjunction with an Arduino. <S> At 95x55mm you should have no trouble fitting it inside the torso or maybe even the head of a small humanoid robot, and it has the processing power of a low-end netbook.
You might be better off with something beefier than the Arduino.
How can I control a CGA screen with an Arduino? I'm getting one of these http://www.old-computers.com/museum/computer.asp?st=1&c=446 I'm planning to build a server inside it. And I was thinking of using the built in CGA-monitor as a statusdisplay (LCDInfo style, or whatever the cool geeks use nowadays).The screen is monochrome amber so it would probably look a bit like the Planar EL-screens some have been using in their mods. And I want to use an Arduino (or something like it) as a middleware solution... PC -> Arduino -> Screen I have been checking up a bit, and CGA is a RGBI signal using TTL-communications. 4 lines (RGB + Intensity), combined with HSYNC (15.75KHz) and VSYNC (60Hz).The 4 "color-inputs" are logic on or off. The combination of these generates up to 16 colors. However, as this is an amber screen, it would probably be easiest to start with "all-high" or "all-low"... White and Black. So the problem is the following... I could probably both wire and code the arduino to flip the TTL-lines on and off, but I'm not sure what I do with the HSYNC and VSYNC inputs. And how to time the TTL-flips to correspond to pixels on the screen. (The standard CGA resolution is 320x200). I'm not very good at electronics, but I'm very good at following instructions, and taking hints Has anyone tried this before? EDIT :Could I maybe use a modified version of this? http://www.eosystems.ro/deogen/deogen_en.html EDIT2 :I don't need to use an Arduino. But I want to keep it as simple as possible. EDIT3 :It might seem that the monitor in question actually is a composite monitor, and not a "real" CGA input monitor. So that probably makes things a bit easier. But I'm still interested in how to generate a pure CGA signal using a microcontroller... <Q> The hsync and vsync signals are just relatively short, negative pulses that reset the CRT's electron beam to the left and top of the screen respectively. <S> Since CGA was basically just NTSC (AKA RS-170) with separate sync and components, the timing of the pulses should be the same. <S> The hsync would occur about every 63.5 microseconds, and the vsync about every 16.7 milliseconds. <S> The vertical timing should be well within the capabilities of an arduino, but the horizontals might be more challenging. <S> During the active horizontal scan you'd need to update the luminance according to the horizontal resolution you're designing to. <S> To get 640 pixels, assuming you use about 53 us of the horizontal trace time to allow for HS duration, and margins to make sure your output doesn't run off the edges of the CRT, you need to output a new pixel about every 82 nanos,. <S> Now, 82 ns is (probably) way to fast to get directly from an arduino, but if you employ an external 8-bit shift register, you only have to load that about every 660 ns, i.e., order of half a microsecond. <S> Of course you could opt for 320 pixels and ease the timing further. <S> If meeting that kind of timing sounds reasonable to you, the exact numbers could easily be had via some light googling. <S> For example, this looks like a pretty good example. <A> Are you set on a Arduino? <S> The Parallax Propeller can generate all sorts of video signals natively. <S> There is code available for Generating VGA and composite video signals, and all the sources are available too, so you can tweak them if you want. <S> Internally, it has a set of specialized video-timing-generation logic. <S> It should be possible to configure the system to drive that screen without too much trouble, though it may require a bit of external SRAM if you want to be able to display full motion in full (well, as full as it gets considering <S> it's a amber display <S> ) color. <S> Also, it's way more powerful than a arduino. <A> I built a VGA pong game around an ATMega168 which might be a good starting point <S> (links 1 2 ). <S> I used the AVGA library , which does all of the VGA timing under interrupt <S> so your foreground code only needs to be concerned with moving sprites around. <S> Another option might be to modify a YBox . <A> http://code.google.com/p/arduino-tvout/ is probably what you need. <S> If you are lucky the internal monitor will accept an NTSC signal. <A> One of the side-effects of this was that when the mode was set to "color" 80 columns, colors would appear as gray stripe patterns rather than as shades of gray. <S> This in turn would render many foreground-background combinations (e.g. blue on black) almost completely illegible. <S> This was rather irksome given that (1) the internal monitor was monochrome, and thus chroma information would be useless to it; (2) even when using an external composite monitor, the colorburst signal was mistimed in 80-column mode, so one couldn't get color anyway. <S> Incidentally, the Compaq's internal monitor seems to be unique; it uses the NTSC horizontal scan rate, but the vertical scan can be either 60Hz or 30Hz. <S> I'm not sure why Compaq decided to use non-interlaced 30Hz, rather than jinxing the vertical circuit of the monitor to work nicely with the 6485's not-quite-right interlaced output, but it's the only machine I've ever seen with a 30Hz display scan.
I've never used CGA but you may be able to adapt one of the (many) Arduino VGA projects to your purpose. The IBM Portable PC behaved as though internal monitor was wired to the composite output of a stock CGA card.
How to find out if a binary number is zero I was implementing the ALU from the specs given in my The Elements of Computing systems book. I am stuck on only one problem. How do I find if a given number is zero or not. One thing I can do is or every bit in the bus, and then apply a not gate on that. But there has to be some other elegant solution. <Q> There's simply no way around ORing all the bits, as unsatisfying as that may seem. <S> However, you are not restricted to two input gates in silicon either. <S> You can build a 4-input NOR gate in CMOS logic by putting 4 series p-type transistors in the pullup network and 4 parallel n-type transistors in the pulldown network. <S> That reduces the depth of your tree topology and therefore your propagation delay. <S> You can only take that theory so far though before the cumulative voltage drop across the series transistors makes the pull-up not pull-up enough to be a "1"... <S> four is a good rule of thumb if I remember correctly. <A> The logic function is the NOR gate. <S> That is the simplest logic function that exists. <A> While it would be possible to have any number of flag bits around (i.e., you could have a 'Z' flag for every register in your CPU), it's usually the thing you've just computed that you're most interesting in, so it makes a certain degree of sense to do it that way. <S> Some of those old CPUs would automatically set flag bits for almost every data move, while others would require you to stick a specific 'compare' instruction in your code if you just suddenly need to know if a certain register was zero. <S> And whether you provide a zero check for every register or just for what's just been computed, there really is no simpler way to check for "is this word zero" than to just OR all the bits together. <A> Some CPUs, MIPS for example, have a register that always contains zero, making testing another register for zero very fast. <A> I am a big fan of or_reduce - most synthesis tools will optimize it to the best implementation since they know exactly what you are doing. <A> I found this post for the same reason as the OP - trying to implement zr for the ALU in The Elements of Computing course.zr is 1 if the ALU output is 0, 0 <S> otherwise <S> The course provides a hardware simulator and a range of built-in predefined chips. <S> One of the built-in chips is an 8-way OR gate. <S> An 8-way NOR gate is not provided. <S> The ALU is 16-bit. <S> I split the 16-bit signal into two 8-bit buses using a multiplexer. <S> Each of these go to a separate 8-way Or gate. <S> The outputs from each of the 8-way <S> Or gates goes to a separate Not gate. <S> The outputs from the two Not gates goes to an And gate. <S> The output of the And gate is the function zr. <S> I tested this using the course Hardware Simulator v2.5.
The typical solution with 8 bit machines was that the ALU would produce a number of 'flag' bits that would represent the outcome of the most recent operation.
Embedded System that is able to connect to the internet I am thinking about starting a project and was just looking for some general input. Where I work our company currently have remote stations that take data in from a radio link and input the data to a sql database. I am responsible for maintaining the stations and their scripts. Currently they are just running on a desktop pc connected to a radio receiver and an internet connection. I have had some limited experience with working with embedded systems in the past, and would like to explore the possibility of migrating the current setup to an embedded system. The most difficult aspect of the project that I can foresee is gaining internet connectivity to a pic chip and having enough memory for the libraries that would be needed to connect to a sql database. Can anyone recommend a resource so I can learn how to connect a pic chip to the internet as well as any recommendation on what kind of pic chip to use? I know this can be quite a daunting task, but I like to think that I am up for the challenge. <Q> Some members of the PIC32 family, such as the PIC32MX675F256H and PIC32MX795F512L include an integrated Ethernet interface. <S> An evaluation board for the PIC32MX795 is available: DM320004 . <S> You can also add an Ethernet controller and use Microchip's free TCP/IP stack with their PIC18, PIC24, dsPIC and PIC32 families. <A> There are many devices that could fit the bill for you... <S> You can find a list of possible boards here . <S> Most of these have ethernet on board as well as large external flash and RAM chips. <S> Many have USB host, meaning that USB flash drives or GPRS modems can be added. <S> On Linux, programming your application is easy. <S> You have a choice of languages (C, C++, python, perl, Java, etc) and it should be straightforward to port your existing PC software. <S> Curl is a good library for HTTP and sqlite is a compact database. <S> But, this ease comes at a hardware cost. <S> In medium volumes, boards are likely to cost around $80-$120 going down to $30-$50 in high (10K+) volumes. <S> If you're looking to cut costs further, you'll want to target a microcontroller. <S> Your code is going to end up much more hardware dependent and <S> development will take longer... <S> Plenty of hobbyist devices use a low end AVR or PIC along with the ENC28J60 ethernet MAC/PHY. <S> See here and here . <S> These systems often use the excellent uIP and sometimes FreeRTOS . <S> For an integrated solution, TI/Luminary have a range of ARM Cortex-M3 devices with on-chip ethernet MAC/PHY . <S> These devices go up to 512KB flash and 96KB RAM, so are capable of complex tasks. <S> But, you won't fit an SQL database inside. <S> There's lots of choice - it all depends on your requirements. <A> I'll throw in the Arduino option into the mix. <S> An Arduino + a WiShield can get you the ability to periodically post data to a webpage (e.g. on an apache server) over an 802.11 network. <S> Your webserver would then handle the job of putting that data in a database (e.g. a PHP script that handles the posted data). <S> This is probably a good place for you to be on the effort to cost curve. <S> Best of luck, this sounds like a fun project! <A> I've been working with Microchip microcontrollers for a long time <S> and I know that family quite well, <S> but I think you would be better served by the solution proposed by the Mbed dev board . <S> This will give you without doubt the fastest route to have Ethernet running on a microcontroller. <S> Take a look at them, the price isn't too bad either. <S> Also, take a look at the forum <S> , there's already a driver for MySQL, although I don't know the reliability of such driver. <S> I suppose it could be a starting point for your particular SQL database (in case it is not MySQL).
If you're looking for ease of programming, consider an embedded Linux solution.
Does solder stick to tin? (not aluminum) Will regular leaded(or non-leaded) solder stick to actual tin or tin foil ? Does the tin have a low enough melting point that it'd melt along with the solder? Has anyone actually tried soldering copper to tin using regular solder? (I tried googling, but everything I found seemed to be about tinning a soldering iron) Edit: Note I was talking about the actual metal Tin. I realize that most "tin foil" is actually aluminum and you've given me some useful information about aluminum but what about actual tin? <Q> Regular solder is a mixture of lead and tin, so chances are that, <S> yeah it would stick to actual tin. <S> Be aware that most of what is today called 'tin foil' is really made of aluminum. <S> You would have to work at it to find tin foil made of real tin. <S> Aluminum is notoriously difficult to solder to, almost but not quite impossible, in fact. <S> Basically you have to exclude oxygen from the surface you intend to join, <S> which is easier said than done. <S> As regards actual tin, you should be able to solder to that, since most common electronics solder incorporates tin as part of the alloy. <A> The melting point of tin is 232°C, so it will indeed melt at normal soldering temperatures, like you suggest. <S> However, soldering isn't about melting two metals together. <S> For instance take copper. <S> Melting temperature is 1084°C, so your soldering iron will never melt the copper. <S> Yet you're able to solder it, because atoms of your solder migrate in the copper's top layer. <S> That happens even when the copper doesn't melt. <S> So solderability isn't determined by melting temperature, but by whether the metallic structure will allow the solder to penetrate it. <S> Aluminium Oxide (what we actually see when we talk about aluminium) is absolutely impregnable for molten solder. <A> Yes, pure tin is wettable with solder. <S> However, I believe there are some alloys that make it particularly difficult. <S> If you just try to solder something directly to a large tin part (e.g. casting), it will be extraordinarily difficult because of its large thermal mass. <S> You would have to use a torch or high-power soldering iron to accomplish that. <S> Alternatively, if you're attaching a wire to a huge part, using a stud (or bolt), nut, and ring-terminal would be more convenient in many cases. <A> Yes. <S> Tin (Sn) is a major component of tin based solders. <S> If you can avoid the collapse of molten metal into the ball it is very possible to make a joint.
Pure tin will melt at a higher temperature than solder, since the alloy has a lower melting point than any of the individual components, so the joint should actually be a solder joint and not a weld.
Latest ARM processors that are not BGA I am looking for an ARM, preferably with an MMU, that is not in a BGA package so hobbyists reflow it at home. <Q> Cavium Networks ECONA family <S> has several ARM922-based processors with MMUs that run at 200-250 MHz. <S> They have a PQFP 128-pin package. <S> I think they're the most powerful non-BGA ARMs you can get (so far as I know). <S> PQFP packages are still pretty hairy to solder, so you might also look at the NXP 17xx series of Cortex M3 chips, which run at 100 MHz. <S> Unfortunately, the M3 core does not have an MMU. <S> I don't know all the packages used, but at least the LPC1758 comes in a LQFP 80-pin package with 0.5 mm pitch. <S> You could also check the LPC2xxx series, but I'm not familiar with them. <S> (that is, you can't buy it for a few months yet). <S> It only runs at 50 MHz and it has no MMU, but PLCCs can use through-hole sockets that can be soldered by hand pretty easily. <S> update (2011-07-28, by stevenvh) <S> We're now 2011Q3, and there's no sign of a PLCC LPC1114 ; it's only available as LQFP48 and leadless HVQFN33. <S> Frankly, it would have surprised me to see it in PLCC; it's an archaic and big package (height: 5mm!), which these days won't get many customers. <A> Another to consider is the Cirrus Logic EP9302 <S> 208 LQFP ARM9 USB Host Ethernet MAC <A> I did some research recently when I was choosing the fastest ARM MCU that I could find and solder myself. <S> My vote is definitely i. <S> MX233: <S> http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX233 <S> ARM926EJ-S <S> ™, 454 MHz maximum speed128 LQFP - small but manageable <S> This might be useful place for research: http://www.embeddeddeveloper.com/ <S> This is a search for MCUs faster than 300MHz and supporting DDR memory: http://www.embeddeddeveloper.com/search/?form_manufacturer[]=Any&form_bit=Any&form_instruction[]=10&form_variant=Any&form_frequency=300MHz&form_flash=Any&form_features[]=&form_features[]=&form_features[]=&form_features[]=&form_i2c=&form_can=&form_usb=&form_eth=&form_ad=&form_pci=&form_ddr=any&processor_part_number=Processor+Part+Number&keyword_search=Keyword&searchaction=1&search_type=proc <S> I can only see i. <S> MX233 being in non bga packaging <A> Allwinner A13 offers Cortex A8 in TQFP ( Similar to LQFP ) <S> http://olimex.wordpress.com/2012/04/24/cortex-a8-in-tqfp-sure-allwinner-a13/ http://www.allwinnertech.com/product/A13.html Datasheets <S> : from Olimex github <S> https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE/A13-PDFs <S> https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE
If that's still too tricky, NXP has announced an ARM Cortex M0 chip, the LPC1114, that will be available in a 44-pin PLCC package in Q4 of 2010
I understand Arduino: now what? Alright, I've played around enough with Arduino that I feel pretty comfortable with it. Anything done now is more learning the electronics than it is the Arduino side of it. What's the next step for my learning? Arduino is a combined programmer / controller, so presumably I need to break that link and start working with a controller chip separate from the controller, I guess? Can somebody point me in the right direction? <Q> I agree with Joby - Arduino is great <S> but I always feel stifled by the framework they surround me with. <S> I'd move on to use straight C on your Arduino and build a lot of the library functionality they provided from scratch. <S> I generally prefer depth before breadth - don't just start on another microcontroller family by using more provided frameworks. <S> Learn a bit more about how to implement some of these functions yourself. <S> Start with a working program and replace the Arduino library calls with your own versions one function at a time. <S> You'll learn a lot about the control registers, timing, bit operations, <S> etc if you havent' already. <S> Try a different IDE like AVR Studio or Code::Blocks. <S> Learn the GCC toolchain. <S> Try more advanced coding techniques - unit tests, coverage, profiling, lint/splint checking. <S> Put an RTOS on the Arduino. <S> A combined programmer/controller isn't a sign of weakness - it's just a design choice. <S> The only 'weakness' that could come from it is the lack of in-circuit debugging. <S> Buy an AVR Dragon and <S> you'll have that licked for $50. <A> Here's some tips for working with AVRs and C. Start off with embedded C with ATmega32 (ATmega AVR series) <A> I think what to learn next depends on what you want to do that the Arduino can't do. <S> That is, I can't see much point in programming a similar chip to do the same things, but with more difficult means. <S> Here are some Arduino weaknesses: Threading, meaning running two sections of code interleaved so that it seems like they're being executed at the same time Medium or high-bandwidth internet stuff, like streaming audio Serious computation, or tasks that require fast computation for fast response <S> Anything that's made easier by having a filesystem around, like datalogging or dealing with images <S> I can imagine two directions to go: <S> More powerful embedded boards with small operating systems, like the Beagleboard or Gumstix Squeezing more performance out of small Atmega chips using hardware interrupts. <S> I can add more detail if you comment about which direction is more appealing. <S> (The second one is definitely cheaper.) <A> Learn I2C, SPI, 1wire and try to interface sensors with such interfaces. <S> Read a lot of datasheets of such sensors and try to understand everything in them. <S> Ask questions when stuck. <S> Learn general electronics and try to interface relays, triacs, what is pull up and pull down, what is sourcing and sinking, how to draw schematics and connect basic drivers to your MCU. <A> As a start, you may want to move from Arduino as platform to AVR as platform. <S> That way, you won't have to buy another Arduino board for each project you do, or for doing projects with friends. <S> This is a fairly simple step (an Arduino is just a conventional Atmel AVR microcontroller but with a special board and bootloader), but its a big one for selling/giving projects to friends. <S> The toolchain is similar too: you use avr-gcc or avr-g++ with make in conjunction with a programming utility to install your program.
Ie, learn how to program/use a virgin AVR microcontroller for your projects instead of the Arduino. Learn MODBUS (RTU/ASCII/TCP) or similar protocol that can open your device to the world once you embed it in the device. Read the ATMega328 datasheet in depth - everything you need is in there.
Three UART connections to an ATMega328? I'm looking at the ATMega328p data sheet , and an Arduino Pin diagram , trying to determine if the chip can support three UART connections. I see that PD0 and PD1 are "USART" In and Out. So does that mean the other 10 or so Digital pins can be used for "UART" communications? I have a need to connect three UART devices through the ATMega chip. The ATMega will forward traffic between two of the devices at a time, depending on which mode it's in. <Q> There is only one UART on the 328P. <S> If your bandwidth is low you can do software emulationof a UART with some of the other digital pins. <S> There is an Arduino library calledNewSoftSerial that enables this functionality. <A> If you don't have enough hardware serial ports, you can use other IO pins for serial under software control. <S> But, don't expect to get 115200bps... <S> http://arduiniana.org/libraries/NewSoftSerial/ <A> You can do what the others suggested and use software-serial or you can use a multiplexer if you don't need your serial ports to be always on. <S> Sparkfun has one that can be used for 3.3V here: <S> http://www.sparkfun.com/commerce/product_info.php?products_id=8970 <S> Basically, if there isn't constant traffic, especially if you only need to send messages or you will only receive one response for one command then you can use the multiplexer. <S> Just switch to the device you want, send commands, wait for response, then switch to another device. <A> I'm new to SBC development, coming from Software Development, but you may want to look into the ATmega 2560 which i believe has 4 UARTs <A> You can add a dual UART with SPI or I2C interface. <S> NXP makes one that I've used on boards. <S> Around $4 from Digikey <S> , it's cheaper than jumping up to a $12 Atmega2560 for a design, and offers more data buffering. <S> https://www.nxp.com/products/analog/signal-chain/bridges/om6273-sc16is752-762-spi-ic-to-dual-uart-irda-gpio:OM6273?lang=en&lang_cd=en <S> &
It is true - only one serial port on the ATMega 328.
What's the highest theoretical energy density for a chemical battery? This is more a physics/chemistry/nanotech question, but what's the theoretical best energy density you could get out of a chemical battery (or fuel cell), if you could arrange atoms in any manner you wanted? I'm thinking of the nanotech batteries described in Diamond Age . How does it compare to current technologies? This is specifically about chemical batteries, which could be built atom-by-atom in the charged state, not nuclear, antimatter, CAM , or other more exotic technologies. <Q> I don't know the actual answer to this question, but I know a least upper bound to the answer, and a means of figuring out the real answer. <S> Battery scientists have a metric called maximum theoretical specific energy; you can read about the definition in Advanced Batteries by Robert Huggins . <S> I don't know what the best battery is, but later in the book , Huggins shows calculations that indicate that Li/CuCl 2 cells have an MTSE of 1166.4 <S> Wh/kg. <S> (5x the capacity of current batteries!) <S> We know that the highest MTSE is at least 1166.4 <S> Wh/kg <S> ; you could use his method to calculate the same value for other chemistries, but the search space is pretty large. <S> I've also seen references on the internet to Li/O 2 and Al/O 2 batteries with MTSE of 2815 and 5200 <S> Wh/kg, respectively. <S> Not sure how credible those references are. <S> Later references, like this 2008 article in the Journal of the Electrochemical Society, suggest that the MTSE for a Li/O 2 cell is around 1400 <S> Wh/kg. <A> If we want to broaden "battery" to mean some sort of device that generates electricity based on a chemical reaction (via magical means), the upper 100% efficient limit would be the chemical enthalpy of the reaction. <S> Calculations for a theoretical "sugar+air" battery: <S> Standard enthalpy of combustion of glucose: −2805 kJ <S> /mol <S> (I think this is a shortcut beyond decomposition into standard elements?) <S> 2805 kJ/mol <S> / 180 g <S> /mol = <S> 4328 <S> W·h <S> /kg <S> Not sure what the most chemically dense compound is, but you could just plug it into that. <S> Nuclear powered cells could be even more magical, <S> E=mc²: <S> 1 kg × c² = <S> 2.5 × 10**13 W·h <A> Current state of the art lithium/sulfur batteries are about 350 Wh/kg. <S> And therefore not unobtainium like many of the listed chemistries. <S> Here's some detailed info: https://en.wikipedia.org/wiki/Lithium-sulfur_battery <A> fuel cells will have higher theretical energy densitites than batteries, but lower power densities. <S> on the other hand, capacitors will have higher power densities but lower energy densities. <S> Consider these theoretical values energy density= voltage x capacity power density= voltage <S> x <S> current capacity= <S> Faraday const x #electrons transferred ( <S> ex: 1 for Li-ion batteries) <S> x 1/MW current depends on the capacity and the rate of discharge. <S> For example at a C/2 rate, you will discharge fully in 2 hours, so if the total capacity is 100 mAh/g, then the current will be 50 mA for 1g. <S> Lets say we have a 2V battery, then the Power will be 100 mW for 1g. <S> (also the energy density of this battery would be 200 mWh/g) <S> voltage = <S> E0cathode - E0anode, <S> E0= - delta G (as in Free Gibbs Energy) / <S> (#charges x Faraday const) in the most prevalent case where you have reduction of a metal ion at the anode (Li-ion included) <S> E0anode is the reduction potential of the metal, see here: <S> http://en.wikipedia.org/wiki/Standard_electrode_potential_%28data_page%29 <S> for example: Li+ +  e− is in equilibrium with Li(s) <S> E0=−3.0401 <S> V
Right now, the most energy dense batteries you can buy are lithium ion, which are in the 100-200 Wh/kg range.
Reading data from a glucose meter What would be the easiest way to read data from a USB glucose meter externally with a microcontroller. Not with the software that is provided. So how could I incercept the digital signals that are being sent out? <Q> The native interface to most glucose meters (Abbott, Bayer, J&J and Roche) is a UART output. <S> There is circuitry at one end of the cable that translates this to USB protocol. <S> The J&J uses a 3.5 mm plug with Tip <S> being Tx and Ring being Rx <S> (Tx and Rx wrt your UART, not the meter), and communicates at 9600 baud. <S> Except for the various J&J One-Touch models, the signal levels for the other brands are typically neither regular UART (0 / 3.3) or RS232 (+-5) levels but some weird combination. <S> Some models also swap Tx/Rx compared to the J&J. Note: <S> the One Touch Ultra and Ultra 2 use a different (more text based) protocol than the binary protocol used by the Ultra Mini <S> (see CoderTao's answer for a link to the latter). <A> If you're still looking for a device, this search suggests that OneTouch UltraMini / UltraEasy have an RS232 interface available, with Software Developer's documentation - which should make it easier to interface with. <A> You'll need an embedded device with USB host to read from your USB device. <S> That implies a certain level of complexity (and cost). <S> The easiest route is probably to use Linux. <S> Have a look at this question for some options: https://electronics.stackexchange.com/questions/2191/options-for-a-small-linux-hw-platform <S> You'll also need a linux driver for your device. <S> If one isn't available, you may have to reverse engineer the existing driver (perhaps using usbsnoop or other USB sniffing tools). <S> Alternatively, there are smaller/cheaper/more energy efficient devices such as the USB AVRs or various flavours of ARM MCUs which can do USB host. <S> If it wasn't for USB - this would be straightforward with an Arduino. <S> Arduino is only capable of being a USB device and only a serial port over USB. <S> If you could find an alternate glucose reader which output a voltage or simple digital signal (I2C/SPI/RS232) <S> then things would be simpler... <A> They provide a good USB stack with some basic device profiles. <S> I have not seen a device profile for a glucose meter, but it's possible they use a HID or CDC profile. <S> If not you may need to get that information from the glucose meter manufacturer.
If you really want to do USB embedded host you can use PIC24 from Microchip. It is possible to read the data with a UART by using a 2.5 mm or 3.5 mm plug to connect directly with the meter.
Electronic circuit switch for arduino Is there anything I can use to replace this circuit? Its a very simple electronic switch circuit, (transistor+zener diode+resistor) The circuit is connect to a remote control, the remote control is activated via http request via the arduino. which is controlled by an iPhone app. Remote control, when the circuit is closed (ie two wires are connected), it is activated. Problem, when I unplug the circuit, or when my power goes down, it will set off the remote control and activate it! I need the circuit to be normally open, when no current is applied. USED: Zener diodle IN4007 Transistor 2N2222 Resistor 1k Note: I dont want to use a relay, not for something this simple! What do I do? alt text http://img689.imageshack.us/img689/5518/circuitc.png alt text http://img688.imageshack.us/img688/1032/201072415pm.jpg <Q> It's hard to tell from that picture, but it looks like you have maybe two wires from the arduino going to the breadboard, and <S> two wires going from the breadboard to that thing on the left. <S> Assuming the thing on the left is the remote control, and that, from what you said shorting its two wires together turns it on, then it's very possible to have, as you say, a transistor that's normally open. <S> The usual thing would be to use a cheap NPN transistor like a 2n2222 or 2n3904. <S> The collector of the NPN would go to the more positive of the two leads from the remote. <S> The emitter would go to the other remote lead. <S> (Use a DVM to be sure which is which, you can't always count on insulation color!) <S> To ensure that the NPN passes no current when no input is connected, you can put a 50K or 100K resistor across the NPN's emitter and base leads. <S> Then, to get input from the arduino, connect the arduino's ground to the NPN's emitter, and connect the arduino control signal you want to use to the NPN's base through a resistor in the range of 1K to 2K ohms. <A> I cannot ascertain much from the photograph and your description. <S> Could you please sketch out your circuit schematic and post that instead? <A> First, the 1N4007 is a rectifier diode, not a zener. <S> It's not very clear from your sketch what it leads to (V+?), but it doesn't belong there! <S> Normally you would place a pull-up resistor here, but I guess the remote does have one. <S> Remove the diode. <S> When you switch the power off it will pull the transistor's collector to ground (minus a 0.7V drop), which indeed may activate the remote.
A circuit like that should not activate the remote when you disconnect the arduino.
What is a digital video port? I see a few questions here casually mention that image sensor modules have a"standard parallel digital video port (DVP) or ... MIPI high-speed serial interface" "Where do I start with embedded video?" "Processor with hardware camera interface port?" "digital video port (DVP) parallel output interface MIPI serial input and output interface" Is there a specific digital video port (DVP) interface standard?Is there a specific MIPI standard?If so, where can I get the details on the signals, standard connectors, etc.?Or is "DVP" merely a generic term that includes a variety of interfaces such as DVI, DMP, HDMI, SDI, UDI, DVB-ASI, FireWire, i.LINK, DisplayPort, etc.?Is there maybe more than one interface standard that (confusingly) has the same "DVP" initialism?In particular, some people seem to think that it's possible to directly connect a 44 pin processor a DVP interface, so apparently they are not talking about the 100 wire SGI DVP interface -- are they perhaps some other DVP interface, or is this merely a typo for one of the above specific interfaces? <Q> more info here <S> DVP is just a parallel bus interface. <S> They are meant to interface with a MCU. <S> Of course, if you're interested in using their product, contact them for a datasheet. <A> Looks like the MIPI specs are only available to MIPI members. <S> http://www.mipi.org/specifications/camera-interface <A> That is, there is a pixel clock, some sort of horizontal sync, some sort of vertical sync, and however many data lines. <S> It is similar to VGA signals , really. <S> MIPI, on the other hand, is a standard which other answers provide links to. <S> You have to pay money to see the spec <S> but if you search around you can find bits and pieces <S> that indicate what the actual signals look like. <S> For cameras, there is the CSI-1, CSI-2, and CSI-4 specs. <S> CSI-1 is older and deprecated. <S> CSI-2 and CSI-4 are newer and consist of differential pairs for the clock and 2 or 4 pairs of data lines. <S> CSI-4 is just CSI-2 <S> but with more available throughput. <S> So that you're not thrown off, there is also MIPI DSI which is a serial interface for displays that uses differential signalling <S> (I assume it is a lot like HDMI). <S> You'll also come across the physical layer terms ; D-PHY, M-PHY, and C-PHY. <S> From what I understand, C-PHY is the most common. <A> Ok so MIPI is off the table. <S> But we can run (e.x. ov5647) <S> sensor over DVP. <S> It's basically a parallel data port that outputs all bits of (10 bits for ov5647) red, blue, white color, probably in that order, on each clock pulse. <S> So for each clock signal, module outputs, first pixels 10-bits for red, 10 bits for green, 10 bits for blue, than second pixels 10 bits of red and so on. <S> Each line start is read trough V_SYNC pulses. <S> After each frame completed, a 2 dimensional data matrix is received, which is something like a bmp file.
MIPI (Mobile Industry Processor Interface) is a standard org. As far as I know, there is no DVP spec but the pinout seems to be something of a de facto standard, even though part manufacturers doesn't always call it DVP.
Efficient inverse (1/x) for AVR I'm trying to find an efficient way of calculating an inverse on an AVR (or approximating it). I'm trying to calculate the pulse period for a stepper motor so that I can vary the speed linearly. The period is proportional to the inverse of the speed ( p = K/v ), but I can't think of a good way of calculating this on the fly. My formula is p = 202/v + 298; // p in us; v varies from 1->100 Testing on the Arduino, the division seems to be ignored completely leaving p fixed at 298 (though perhaps this would be different in avr-gcc). I've also tried summing v in a loop until it exceeds 202 , and counting the loops, but this is quite slow. I could generate a lookup table and store it in flash, but I was wondering if there was another way. Edit : Maybe the title should be "efficient divide"... Update : As pingswept points out, my formula for mapping period to velocity is incorrect. But the main problem is the divide operation. Edit 2 : On further investigation, divide is working on the arduino, the problem was due to both the incorrect formula above and an int overflow elsewhere. <Q> One nice thing about division is that more or less everyone is doing it. <S> It is a pretty core feature of the C language, and compilers like AVR-GCC (called by the Arduino IDE) will choose the best division algorithm available, even when the microcontroller does not have a hardware division instruction. <S> In other words, you don't need to worry about how division is implemented unless you have a very strange special case. <S> If you do worry, then you might enjoy reading Atmel's official suggested division algorithms (one optimized for code size, and one optimized for execution speed; neither take any data memory). <S> They are in: http://www.atmel.com/dyn/resources/prod_documents/doc0936.pdf <S> which is the Application Note "AVR200: <S> Multiply and Divide Routines" listed on the Atmel page for its (reasonably big) <S> Atmega processors like the Atmega 168 and Atmega 328 used in the standard Arduinos. <S> The list of data-sheets and application notes is at: http://www.atmel.com/dyn/products/product_card.asp?part_id=4720 <A> looks to me like all you need <S> is a 100-entry lookup table. <S> Doesn't get much faster than that. <S> #define <S> VALUE_FOR_V_EQUALS_ZERO 0uint16_t formula_lookup[100] = <S> {VALUE_FOR_V_EQUALS_ZERO, 500, 399, 365, 348, ..., 300};...//"calculate" formulap = formula_lookup[v > <S> 67 ? <S> 67 : v]; EDIT <S> you actually only a 68 value lookup table since values of v greater than 67 always evaluate to 300. <A> There are some very good techniques mentioned in the book "Hackers Delight by Henry Warren and on his website hackersdelight.org . <S> For a technique that works well with smaller microcontrollers when dividing by constants have a look at this file . <A> Your function doesn't seem like it would give the result you want. <S> For example, the value 50 returns roughly 302, while 100 returns roughly 300. <S> Those two results will cause almost no change in the speed of the motor. <S> If I understand you correctly, you're really looking for a fast way to map the numbers 1-100 to the range 300-500 (approximately), such that 1 maps to 500 and 100 maps to 300. <S> Perhaps try: <S> p = 500 - (2 * v) <S> But I might be misunderstanding-- <S> are you trying to calculate the on-time of a constant frequency square wave? <S> What's the 298? <A> An efficient way to approximate divides is by shifts. <S> e.g. if x = y / 103;dividing by 103 is the same as multiplying by 0.0097087, so to approximate this first select a 'good' shift number (i.e. a base-2 number, 2,4,8,16,32 and so on) <S> For this example 1024 is a good fit as we can say that 10 / 1024 = 0.009765Its <S> then possible to code: x = <S> (y * 10) <S> >> 10 <S> ; Remembering of course to ensure the variable y does not overflow its type when multiplied. <S> Its not exact, but its quick. <A> On another note if you are trying to do a divide on a CPU that doesn't support divide there's a really cool way to do it in this Wiki article. <S> http://en.wikipedia.org/wiki/Multiplicative_inverse <S> To approximate the reciprocal of x, using only multiplication and subtraction, one can guess a number y, and then repeatedly replace y with 2y <S> − xy2. <S> Once the change in y becomes (and stays) <S> sufficiently small, y is an approximation of the reciprocal of x. <A> This process here looks mcu-friendly, though it might need a bit of porting. <S> Though it seems as if the LUT would be easier. <S> You would only need 100 bytes, less if you used some interpolation, and since the LUT is filled with constants then the compiler might even locate it in the code area instead of the data area. <A> Check to make sure that the division is being performed as floating point. <S> I use Microchip not AVR, but when using C18 you need to force your literals to be treated as floating point. <S> Eg. <S> Try changing your formula to: p = 202.0/v + 298.0; <A> You want fast so here goes..... <S> Since the AVR cant do normalisation efficiently (shifting left until you cant shift anymore), ignore any pseudo floating point algorithms. <S> The table will store reciprocals scaled by a large number (say 2^32). <S> You then implement a unsigned32 x unsigned32 = unsigned 64 multiplication in assembler, so answer = <S> (numerator * inverseQ32[denominator]) <S> > <S> > 32. <S> I implemented the multiplication function using inline assembler, (wrapped in a c function). <S> GCC does support 64-bit "long longs", however, to get the result you have to multiply 64bits by 64bits, not 32x32=64 due to C language limitations on 8-bit architecture...... <S> Downside of this method is you will use 4K x 4 <S> = 16K of flash if you want to divide by integers from 1 to 4096...... <S> Very accurate unsigned division is now achieved in about 300 cycles in C. <S> You could consider using 24 bit or 16 bit scaled integers for more speed, less accuracy. <A> p = 202/v + 298 <S> ; // p in us; v varies from 1->100 <S> The return value of your equation already is p=298 since the compiler divides first then add, use integer muldiv resolution that is: p = <S> ((202 <S> *100)/v + <S> (298 <S> *100))/100 <S> Using this is same multiply a*f , with a=integer f=fraction. <S> That yield r= <S> a*f but <S> f=b/c <S> then r=a*b/c <S> but it doesn't work yet because position of operators, yield the final r=(a*b)/c or muldiv function, a manner to compute fraction numbers using only integer.
The simplest way for very accurate and fastest integer division in an AVR is via a reciprocal look-up table.
Why put the bits of a port on non-adjacent pins? Some micros have all bits of a port nicely lined up, while others' bits seem to have been scattered by the winds to all four points of the compass. Why? <Q> Often this has alot to do with lead inductance. <S> You need to keep your grounds spread out, and based on layout decisions in the chip internal to the package it may need to spread out the I/O pins. <S> Would you rather have ground problems or spread out pins. <S> In general, I use #define to handle which pin I am using and all but forget which actual pin it is. <S> Since most people do this also, chip manufacturers know this and focus on electrical parameters. <A> I occasionally do chip design - as mentioned above many chips will intersperse power and grounds within parallel buses so that the drivers will have enough power (lead inductance is an issue - plus you don't want to starve the core when driving external loads). <S> However there are other issues <S> - you might be constrained for on-die routing resources meaning it makes more sense to push those issues externally - I worked on a PCI interface where we tried hard to push pins to the right places (total system cost means getting to a 4 layer board can be important) <S> but were constrained in some critical timing paths that meant we had to push some of the timing budget off-chip by moving the pads closer to the rest of the logic they drove while assuming longer external traces <S> Sometimes you design a die but it goes into multiple packages - <S> maybe the BGA package is optimally pinned out but not the QFP - or maybe the package was chosen late in the design cycle after the pads on the die were already chosen <S> But remember for some buses you don't always have to wire up all pins exactly - if you're wiring up a SRAM/DRAM (or sometimes even flash if it's not being pre-loaded) you can often switch bits within a byte or even (carefully! <S> depends on the chip) address bits <A> Might have something to do with the alternate uses for a pin. <S> If you have an oscillator connection then it would be a good idea to have it kept away from high-noise paths for instance.
So there's lots of reasons - sometimes it really is that the chip designer didn't think ahead
In the case of audio, would it be accurate to think of a potentiometer as a fader between two inputs? I kinda already asked the question in title, but I will reiterate — In the case of audio, would it be accurate to think of a potentiometer with, for example, three lugs, as a fader between two inputs? Please tell me why that's dumb or not dumb or something! <Q> A pot can be used as a fader between two inputs, but not at constant power, so it's probably not a particularly useful way to think of it. <S> Here's the problem: suppose you have a 10k pot with an input attached to each end and the output coming out the wiper. <S> When the wiper is moved to either end of its range, you get full volume out of one channel and a severely attenuated contribution from the other. <S> When the pot is set to the middle of the range, both inputs are attenuated equally, but they're not at half-volume-- <S> they're much quieter. <S> In the case of audio, I think it would be better to think of a pot as a single-channel fader that has an extra lug on the end. <S> (I don't actually know whether in real audio equipment the extra lug has some use that I haven't thought of. <S> Anyone know?) <A> You could use it that way, as a blend or balance control, by connecting each leg to an input and the wiper to a high input impedance amp. <S> More commonly, you have two 3-terminal pots, and each acts as a volume control (one leg to the input, the other to ground), and are then fed to a summing amplifier to mix them. <S> That way you can control the level of each instead of just their relative difference, and you can use log-taper pots so that the change in loudness is proportional to the change in angle of the knob. <S> simple mixer circuit with two volume controls http://www.circuitdb.com/downloadimg.php?fileID=130 <S> (source: aaroncake.net ) <A> Maybe it will help some of you guys to see a simulation of this. <S> Full size can be found at http://www.flickr.com/photos/kellenjb/4991010642/lightbox/ <S> The reason I wouldn't do it this way is because you might have sources with different resistance. <S> Or be driving something with a much lower resistance. <S> Or... well lots of things. <S> It is just much cleaner to use an op-amp adder. <S> ADDITION:1) <S> If you make the 50K pot larger, lets say 500K, you get a much smaller signal out when you are at 50% on the pot and the same signal out as the 50K when you change it to the 0% and 100%. <S> 2) <S> If you keep the 50K pot but change R2 and R3 to be bigger, you aren't able to get purely <S> just the signal from 1 source over the other and the effect of the percentage that the pot is at becomes less and less important. <S> 3) <S> If you keep the pot and the source resistances the same but change the output to be 8ohms (such as a speaker might be) you get an effect similar to #1. <A> Your + and - audio input signal connect to the non-wiper pins of the potentiometer. <S> The attenuated output + signal connects to the wiper pin, while the attenuated output - signal connects to the same pin you connected the - audio input signal to. <S> That application actually works, and is how you actually make volume controls. <S> To think of a single, unaided pot as a fader really stretches the analogy into inaccuracy land. <S> (*) - For pots that have a audio/log taper, or a simulated log taper . <A> I know this question is old, but I just wanted to add that I've done exactly what the OP asked about as a volunteer sound guy with a full board. <S> We had two click tracks (electronic metronomes, basically) that needed to be mixed in with the musicians' headphones at the same volume each. <S> So I did this: <S> simulate this circuit – <S> Schematic created using CircuitLab <S> I also tied all of the grounds together, not shown here. <S> I had the drummer start both tracks and adjust the pot until they were equal to each other in his headphones, then I mixed the combined signal into all the headphones as usual. <S> Worked perfectly.
It's better to think of a potentiometer as a volume control(*) for a single audio channel.
APC220 and the not so magical RF-Magic I have purchased a pair of APC220 modules.I also purchased a USB TTL module to program these.I down loaded the drivers from Silabs and the RF-magic 4.2 software which is supposed to be able to program thee modules.The RF-Magic program is proving less than magical as it does not see the device.Tried 3 different computersWhile trolling the web for suggestions option I came across the APC220 software which finds my device but does not allow me to change the settings that I need to change as it is for a different type of device using the same chip. I tried a FTDI cable but this does not help.Any suggestions?Warren <Q> Sorry to have to say this, but I also had the same issues to the point of frustration. <S> Unfortunately they were a complete failure to me. <S> Much better off with XBees, which worked almost instantly. <A> I had the same frustrations with RF-magic V4.2 communicating with APC200A-43A (also sold as CM-12111. <S> I finally got it to work by starting RF magic, connecting the APC200A, then applying power to the APC200A. <S> I think the APC200A has a power-on start up routine that senses the "55AA" sequence being sent by RF-Magic and dynamically adapts to the 119k baud rate RF-Magic uses. <A> I also had issues with FTDI, but was able to fix it by changing the driver settings from Device Manager <S> (win XP):- select the Ports (COM/LPT) / USB Serial Port (COMx) <S> / Properties- <S> Port SettingsTab/ Advanced- <S> Change USB Transmit sizes (both TX and RX) to 128- BM options, <S> Latency timer to 2ms. <S> Also other values probably work, I only tried these and it was all good! <S> I had to first connect the data lines and ground, then put in the VCC to power the module, and RF-Magic sees it immediately. <A> Find the RF-Magic executable: <S> i.e. APC22X_V12A.exe: <S> Right-click and goto "properties". <S> Goto the compatibility tab. <S> Set the checkbox <S> "Run this program as Administrator". <S> Now run RF-Magic, you will have to confirm the program is safe to run. <S> If it works the "PC Series" option will show COM1, and in the bottom of the window it will say "COM1 Opened". <A> See my article: http://kraksat.pl/en/apc/ <A> For configuring the APC220 I used this instead of RF Magic: https://allodox.wordpress.com/2013/05/01/configuring-an-apc220-rf-transceiver-with-arduino/ Workd great, also for Raspberry <S> after translating it to Python. <S> On PC side I tried to use the RP6v2 Adapter (WT DONGLE). <S> It only worked with pin 1 (SET) of the APC220 module disconnected - not for configuring but at least for transmitting and receiving data.
Basing on datasheet I wrote a small script that reconfigures APC-2x0 transceivers (and also works on Linux!).
Good board for DIY temperature control/readout I want to do a project where the temperature of a device is controlled by toggling on/off a heating element (120VAC),presumeably by using a relay. I would like a board that has an input for a temperature sensor of some sort and some form of a display and buttons to allow me to create a user interface. Whether the board itself has the relay or not does not matter (I can use 5V to trigger a 'powerswitch tail' if I need to). The board would definitely need a display of some sort (nothing fancy needed), some buttons, and the ability to measure temperature accurately (+/0 0.5 °F worst case). Does anybody know of anything that fits the bill? <Q> I've seen a couple of "buttons and LCD and thermocouple" kits. <S> If none of them are adequate for what you are working on, I suspect you could pick almost any "buttons and LCD" kit and almost any "thermocouple interface kit" and connect them.(in no particular order): == <S> buttons and LCD and thermocouple <S> == <S> Adafruit: " <S> A thermocouple datalogger based on the Arduino platform" and at Luke Miller's blog Sparkfun Reflow Toaster Controller (The Arduino controlled Espresso Machine sounds similar to what you want, but alas, it's apparently not for sale). <S> = <S> = <S> buttons and LCD = <S> = <S> Arduino shield <S> LCD+buttons <S> Portable <S> MegaPalm Arduino shield <S> LCD+buttons <S> Parallax Propeller <S> LCD UI Module <S> Microchip PIC <S> LCD+buttons <S> 28 Pin PIC Terminal Development Board <S> TI <S> MSP430 LCD+buttons <S> MSP430F449 Evaluation Board <S> ARM MCU <S> LCD+buttons LPC2106 Terminal Development Board EasyWEB2 Internet Development Board <S> has LCD+buttons Orangutan LV-168 Robot Controller Orangutan SV-328 <S> Robot Controller <S> == thermocouple interfaces = <S> = <S> If you ever need to measure temperatures above 125 C (257 F), you'll need to use a thermocouple and a thermocouple interface <S> chip.(Thermistors and IC sensors such as the Analog Devices AD592 and the Maxim DS18B20 cost less, but generally can't handle temperatures above 125 C). <S> Arduino Thermocouple Shield RepRap thermocouple sensor (controls the heater head for the right temperature for melting and extruding plastic) <S> Multidisplay project and Multidisplay video (measures various temperatures in an automobile engine) flue temperature sensor 4-Channel Thermocouple Input Arduino Shield <S> (I've made this "community wiki" <S> so others can add really good/cheap examples and trim out obsolete items). <A> Those who know me realise I am biased towards the Arduino way of doing things, so if you had <S> an Arduino, HD44780-compatible LCD, Analog Devices TMP36, that powerswitch tail from Adafruit, the job could be done very easily. <S> You might find this article of interest, it discusses how to use that temperature sensor, LCDs and making decisions based on temperature. <A> All the parts would be relatively easy to get and put together: <S> I think this complete DIY approach would seem most obvious and you won't "waste" a kit doing it. <S> If you want to look for a ready board, something with enough PIO, ISP, some sync serial bus for the sensor and ready buttons and displays would probably be. <S> Maybe some available memory for logging <S> and/or UART <S> in case you want to attach it to a computer at some point. <S> Which particular one probably depends on which one you can get and from where. <S> I'd probably pick an ATTiny series AVR and a separate LCD module, some stripboard, and pin headers and work from there. <S> Either way, I don't think trying to fit the sensor and/or relay (that needs to have one half well isolated) <S> on the same board is a good idea unless you have a really good reason for it. <A> My design (Eagle files and Arduino sketch) is on the web: http://dorkbotpdx.org/blog/scott_d/temperature_controller_board_final_design <S> The design includes an Arduino compatible and has provision for a MAX6675 thermocouple chip and an IR temperature sensor based on a modified IR thermometer from Harbor Freight Tools. <S> It also has a built in interface for a common 16x2 (or similar) LCD, inputs which could be used for buttons (although I'm currently using an encoder instead) and a digital output for controlling an SSR or other relay. <S> A number of local hobbyists are using this board for temperature control of various projects including reflow hotplates. <S> I note that you require <S> +/- <S> 0.5 <S> °F temperature accuracy, which is better than most thermocouples can provide, so you might have to find some other type of temperature sensor for your project. <S> If you want to use my Eagle files to make a PCB, I can recommend the Portland DorkBot group PCB order: http://dorkbotpdx.org/wiki/pcb_order . <S> It is inexpensive and designed for hobbyists.
LCD module, any simple MCU, some suitable digital temperature sensor, buttons... and the relay should indeed be easy to control. It depends on the temperature range you need to measure.
Going through Soldering tips quickly I seem to be going through soldering tips at a breakneck pace. Four or five hourly sessions, and it's corroded all to hell. Does this sound about right, or is there something I should be doing differently? It's a standard 40 watt cheapo iron. <Q> One thing I haven't seen mentioned yet is this: Whenever you are planning on not using the iron for more than about a minute, load the tip with solder. <S> This way, the solder oxidizes in the air, instead of your tip. <S> An unprotected tip will start to oxidize pretty quickly in air, and the longer it is allowed to do so, the worse it gets. <S> When you are ready to use the iron, do the following: knock the solder off into a jar flash the tip on a sponge (cover the sponge with a paper towel so your sponge stays clean) and get to work. <S> As soon as you're done, recoat the whole working surface with solder. <A> Tell us more specifically what kind it is. <S> Our Wellers were burning up from the temperature sensor malfunctioning. <S> They use a magnetic sensor, which we think were ruined by soldering next to the big magnets of loudspeakers, so they were permanently magnetized and stayed on perpetually. <S> The WTCPx models use a magnet and a bit of iron allow which has its Curie point at the set temp. <S> When the Curie temp is exceeded the magnet is no longer attracted to the alloy piece and the magnet is pulled back by a spring. <S> This motion opens a mechanical switch. <S> These irons will only regulate at the temp labeled on the back of the tip. <S> http://www.electronicspoint.com/weller-soldering-iron-sensor-t49505.html <A> Some tips for maintaining your tip are in Soldering Iron Maintenance . <A> Plated tips last longer ( much longer ) than unplated. <S> Also a thermostatically regulated tip does not overheat and eat the tip. <S> Just a couple of tips. <A> Two things I have experienced: <S> Thermal shock (loading the tip with solder, aggressive scrubbing against a wet sponge, repeat) will help break this up, although you may also need a tip tinner (again, aggressive scrubbing). <S> Prevent this by always cleaning and tinning the tip before turning the iron off. <S> Pieces of the tip going away - chunks missing. <S> The temperature of the iron is (way) too hot. <A> Okay, basics: <S> You have a sponge and you're using itin an OCD-like fashion <S> right? <S> Do youhave temperature control? <S> Lower thetemperature. <S> You tin the tip a littlebefore applying it to the pad,correct? <S> Do you have a tip tinnerand/or brass sponge?
Tips oxidize dramatically faster when they're too hot, so check your temperature if you can. The tip is dirty (like: caked-on vulcanized whatever that refuses to come off).
Which PCB software has the best autorouter? I know that lots of people out there feel that autoroute results are not useable. I find that the autorouter is a good way to get a good placement. I use eagle. I do a basic placement, autoroute everything and look where my wire crossings are. Where I can reduce wire length. ripup, repeat. The thing is, the eagle router really isn't that good. I often get routes that should be doable with a straight shot, yet eagle insists on adding jogs. I feel that given a good placement, many routes should be obvious. I don't want to click them all by hand. So I'm looking for something better. toporouter is intriguing. The problem there is I don't know how to write an output from eagle that it reads. <Q> The one between your ears. <S> Seriously, PCB software autorouters leave a lot to be desired, especially the cheap ones. <A> Freerouting has an improved autorouter for Eagle. <S> http://jeelabs.org/2009/05/17/better-pcb-auto-routing/ <A> Pulsonix uses the Electra autorouter, as do several other packages; it's very good. <S> It can be used with Eagle. <A> Altium ostensibly now uses topological routing , though I haven't had much of a chance to play with it yet. <A> Well, I'm one of those people that don't use autorouter, but, if you want to use it, I would recommend <S> FreeROUTE <S> and, to keep everything free, use KiCAD for schematics and everything else! <A> The previous version of their software were pretty buggy, but as of version 3 it seems stable. <S> For a point of reference, I had a 6"x4" board with about 1000 nets and it was able to successfully route all but 40 of them. <S> Their auto-router even has options to fanout traces, relax routing, or set the desired trace tolerances. <S> The software itself is a pretty full feature (for being free) <S> PCB design too, boasting 3D modeling, the ability to read in netlists in a variety of formats, as well as output mechanical drawings. <S> I'm not sure of it's ability to inter-operate with Eagle, but it might be worth a try. <A> I've used an autorouter (admittedly, a high-end one - Mentor Graphics Expedition) on every board I've done (10 years+). <S> If you have constraints like "only on this layer" "These two signals form a differential pair" "must match lengths with these nets" " <S> The time delay from 'here to here' must be the same as 'from somewhere else to a fourth place +100ps'" <S> then you must tell it about them. <S> The autorouter will attempt to respect those constraints (or tell you where it failed). <S> Once you have an autoroute setup which completes well it allows you to experiment with placement, via sizes, removing layers, etc. <S> very quickly to get an idea as to how much slack is in your board design. <S> The places I don't autoroute tend to be power supplies, as it's easier just to put the copper shapes around the pins that need it than flag all the nets which need to be "chunkier".
I've used Sunstone Circuits PCB123 V3 's auto-router with great success.
VHDL: Converting from an INTEGER type to a STD_LOGIC_VECTOR I built a mod-16 counter, and the output result is a INTEGER (all the examples I saw used INTEGER). I built a hex-to-7-segment-display decoder, and its input is a STD_LOGIC_VECTOR (wrote it that way because it was easy to map out the truth table). I'd like to connect the output of the counter to the input of the decoder, but I get 'type mismatch' errors when trying to compile in QuartusII. Is there a way to convert from a INTEGER type to a STD_LOGIC_VECTOR type in a VHDL listing? <Q> As others said, use ieee.numeric_std , never ieee.std_logic_unsigned , which is not really an IEEE package. <S> However, if you are using tools with VHDL 2008 support, you can use the new package ieee.numeric_std_unsigned , which essentially makes std_logic_vector <S> behave like unsigned. <S> Also, since I didn't see it stated explicitly, here's actual code example to convert from an (unsigned) integer to an <S> std_logic_vector <S> : use ieee.numeric_std.all;... <S> my_slv <= <S> std_logic_vector(to_unsigned(my_int, my_slv'length)); <A> As LoneTech says, use ieee.numeric_std <S> is your friend. <S> VHDL is a strongly typed language. <S> I've written more on this subject on my blog <S> Fundamentally, I'd change your 7seg converter to take in an integer (or actually a natural , given that it's only going to deal with positive numbers) - the conversion is then a simple array lookup. <S> Set up a constant array with the conversions in and just index into it with the integer you use on the entity as an input. <A> You may be interested in using the types unsigned and signed from ieee.numeric_std . <S> They're compatible with std_logic_vector , but have a numeric interpretation (binary or 2-complement). <S> There's also the option to put such an interpretation on std_logic_vector , but this is not recommended . <A> As the main answer says, the recommended method is as follows: <S> use ieee.numeric_std.all;... <S> my_slv <= <S> std_logic_vector(to_unsigned(my_int, my_slv'length)); <S> However, I would like to elaborate about why this is recommended, and why VHDL has such a seemingly convoluted way of converting integers into std_logic_vectors. <S> It comes down to how these types are viewed by the tools. <S> A standard_logic_vector is literally a bunch of 1s or 0s. <S> I have 10001. <S> What number is this? <S> Well, it depends. <S> Is it signed or unsigned? <S> Ths SLV doesn't know or care. <S> How many bits? <S> Well, how long is your SLV? <S> An integer is signed, and usually 32 bits (if i remember correctly). <S> Stage 1 <S> :Make my integer shorter, and unsigned. <S> That's this part: to_unsigned(my_int, my_slv'length)); <S> "I have this integer, I want it to be unsigned, and I want it to fit into the length of my SLV." <S> Stage 2 <S> : Then, take those bits and use them to drive the my_slv. <S> my_slv <= <S> std_logic_vector <S> (...) "Take these bits, and use them to drive my slv" (A note on terminology. <S> A <S> <= B in VHDL is read out loud as "A is driven by B") <S> Combined, this gets you: my_slv <= <S> std_logic_vector(to_unsigned(my_int, my_slv'length)); When coming from a traditional programming background, it's very easy to get stuck in a programming way of thinking. <S> But in VHDL the code you write has physical implications in hardware. <S> Knowing why this method works and is recommended is one step closer to thinking about what you're writing in hardware terms. <S> Bonus tip: <S> functions prefixed by to_ are ones that shorten/change the operands. <S> They make them unsigned or a certain length or both. <S> This is why to_unsigned requires you to specify the length. <S> The functions without to_ (straight std_logic_vector(...) in this example) are used when types are directly compatible already. " <S> Take these bits and stuff them in this type, no modifications required". <S> These don't have a length argument because both sides are already the same. <S> So when constructing things like this, I don't need to look it up, I just think about how I'm changing the data. <A> To convert an integer to std_logic_vector <S> you have several options. <S> Using numeric_std: <S> vect <= <S> std_logic_vector <S> ( to_unsigned( your_int, vect'length)); or vect <= <S> std_logic_vector( to_signed( your_int, vect'length)); <S> Using std_logic_arith: <S> vect <= <S> conv_std_logic_vector <S> ( your_int, vect'length); std_logic_arith is a not an ieee standard, but most tools compile it into the IEEE library and it is widely used. <A> Let's say that your 4-bit counter had an INTEGER output SOME_INTEGER, and you wanted to convert it to a 4-bit <S> STD_LOGIC_VECTOR SOME_VECTOR <= <S> conv_std_logic_vector(SOME_INTEGER, 4); <S> You can also use this to initialize vectors with meaningful numbers SOME_VECTOR <= <S> conv_std_logic_vector(9, 4) <S> ; -- instead of "1001" I think you may need to add "use IEEE.STD_LOGIC_ARITH.ALL;" and/or STD_LOGIC_UNSIGNED. <S> The complementary operation is conv_integer(vector). <S> I like to use this when I do comparisons. <S> So I might declare constant SOME_CONSTANT : <S> integer := <S> 999; <S> And then, later, I can use this in an if statement <S> if (conv_integer(SOME_VECTOR)=SOME_CONSTANT) then OTHER_VECTOR <= <S> (others = <S> > ' <S> 0');end <S> if; EDIT: You shouldn't need to declare the variable as an Integer. <S> Try changing the declaration to std_logic_vector instead. <S> The + and - operators work on std_logic_vectors.
You can convert a std_logic_vector to an integer , but you'll have to cast it as signed or unsigned first (as the compiler has no idea which you mean).
how to count 2 wheel encoder signal? I'm looking to a simple solution to keep the position of a robot. It has two DC motor and one wheel encoder for each. The encoder are incremental type. I need to be able to get the current count of increment from an atmega. I found some chip like the LM628/629 who will do great job, too great in fact, because it cost ~50$. Do you know a dedicated IC that has only the count (in both direction) features for a wheel encoder, Or is it possible to make à simple one with an attiny ? <Q> "Do you know a dedicated IC that has only the count (in both direction) features" ? <S> You may be surprised to learn that a few simple, cheap, generic logic chips are sufficient to decode a rotary encoder -- it doesn't require some special chip specifically customized for rotary decoders. <S> Those outputs can be wired into the "direction" and "clock" inputs of any up/down counter -- such as, for example, the CD4029, the CD4516, the CD40193, 74HC193, etc. <S> "is it possible to make à simple one with an attiny" ? <S> Yes, you can make a simple quadrature encoder with an ATtiny. <S> Some tips for connecting a quadrature encoder to a Atmel chip and decoding it in software are at: <S> Alex Brown's Robotics Page: <S> Using Encoders Arduino Playground wiki: <S> Reading Rotary Encoders Keith's Electronics Blog: LED Calculator with Rotary Quadrature Encoder <S> If you have relatively few pulses-per-second, you might be able to run the 2 signals from each encoder directly into your main ATmega and use the above techniques to do it all in software, without any external conversion hardware. <A> Wheel encoders are very easy to use for dead-reckoning systems. <S> If you have just a slotted wheel and two detectors it'll be a quadrature encoder; you call one of the signals your clock and the other one your direction. <S> Get both signals into your microcontroller and either set it up so that it counts clock pulses (i.e. an event counting algorithm). <S> Whenever you get a clock pulse, check the direction line. <S> It will always be '1' for one direction and '0' for the other. <S> The fancier (more expensive) encoders are usually Grey code encoders and are less suitable for dead reckoning, although they will give you better dead reckoning position due to their higher accuracy. <S> You could feed the output of one of them into your microcontroller and have an interrupt or timer that reads the position of the wheels and determines how far and in which direction the robot moved. <S> This is a more complicated solution. <S> Be aware that dead reckoning systems do drift over time and <S> unless you have some means of resetting the dead reckoning system your robot's idea of where it is in space will become more and more inaccurate. <A> One approach might be to use a programmable logic device as a gray-code ripple counter with enough stages that you can simply poll the value at a convenient rate and not lose counts. <S> Note that one advantage of a gray-code ripple counter over some other approaches is that there's no danger of noisy inputs glitching the counter <S> provided that no input changes when the other input isn't stable.
The Codewheel Generator Page has a few relatively simple circuits that decode the 2 rotary quadrature outputs into a "direction" and "count" outputs.
How can I generate a logic pulse from a broken IR beam? I would like to trigger a [7]555 timer when a phototransistor stops receiving light from an IR led, more precisely when the (expected to be smallish) signal from the light-sensitive voltage divider, consisting of a phototransistor and a resistor, changes quickly. How should I wire the timer? I expect if I decouple the light sensor from the timer with a capacitor I might be able to get a sufficient voltage swing to trigger the timer from a small but quick change in the signal? I would like to implement a version of the LED staircase . The project idea is to build a number of as-cheap-as-possible photodetector-triggered lamps on one side of a 3-foot gap opposite IR LED throwies on the other. When someone passes by they break the beam and trigger an entertaining trail of lights that slowly turn off, one by one, a couple of seconds later. I was overthinking the problem. After some experimentation it appears all I need is a photodarlington (a phototransistor by itself is not sensitive enough) in series with a resistor. This forms a voltage divider with a usable signal. If a potentially long low pulse is a problem then merely decouple the photodarlington from the logic with a capacitor differentiator. <Q> I would start it using a LM567 to detect the presence of someone on the stair. <S> I recommend this circuit: http://www.mondotronics.com/PDFs/3-337_Mod_IR_v22.pdf Using the output of this circuit, you should trigger your LM555 to keep the light on as much time as you want, but not using a large capacitor as you mentioned, but just a LM555 in monostable operation. <S> The output from LM555 can drive a transistor to control as many LEDs as you want! <S> Some level or signal inversion maybe required. <A> This may seem like a challenge, but I can give you a link to a relatively common circuit . <S> You can then use the photo-transistor as a discharge from the capacitor. <S> when the transistor has light, it will keep the capacitor discharged, you just need to use the potentiometer to tune the circuit to have a low enough resistance to charge the capacitor when the transistor has no signal. <S> There is another easy way to do this with two 555 timers, but I need to draw it. <S> Let me know if you need it, another answer popped up. <S> I am still posting this as another option. <S> I was going to use a 555 to detect the change, and then have it trigger a 555 to stay on as long as you want, as andre says. <A> I'm sure there's some way to create an analog solution to this <S> but nowadays I wouldn't even bother. <S> If a small microcontroller can handle it, use that. <S> I'm not sure if I'll ever use 555 timers anymore because a microcontroller can do it and so much more in the same package. <S> True, the ATTiny45 costs about 4x the LM555, but if your application requires a microcontroller it might as well do one more job. <S> Using the 555 has always been a lot more difficult for me than figuring out some C code to do the same thing. <A> I would suggest using a microcontroller which is programmed to send out semi-random pulses of IR, and uses an ADC to measure the amount of IR received during the times the emitter is on and the times it is not. <S> Such an approach will allow each detector to determine whether it has a clear shot to its associated emitter, even if there are other emitters nearby.
One could if desired rig the detectors and emitters in such a way that each detector could be picked up by two or more emitters and vice versa; if the processor connected to a receiver knew the timing of all the emitters it could see, it could determine which emitters' signals the detector was picking up.
Launching a new product as a student I'm a student living in the UK. I have this great idea for a product that fills a niche market and it interests me. It's a powerful on screen display module with datalogging capabilities, and it's open source hardware and software. See http://code.google.com/p/super-osd/ . I want to start selling these modules. I have PCB designs and I'm ready to order the components, but what route should I take for manufacturing the modules? I see three main possibilities: Etch my own PCBs and solder components on - pretty much a no go as I'm dealing with double sided surface mount boards. Order PCBs cheap from China and solder all 40 odd (0603, TQFP44 etc.) components on myself. (Probably the cheapest option but lots of manual labour.) Get a quote for PCB+assembly. Any ideas? <Q> In terms of quality and reliability, you cannot beat machine placement on professionally manufactured PCBs. <S> You will most likely find that option #2 + #3 will work best - get the PCBs made offshore by a reputable low-cost shop that deals in prototype volumes (which may or may not be easy) and shop around for contract assembly places. <S> Have you considered sourcing the parts yourself (i.e. issuing a complete parts + boards kit to prospective builders) or are you looking for someone to supply parts as part of the service? <A> I would say there are three major factors that would need to be considered before making a decision. <S> How many products are you planningon selling yearly? <S> If it is a lot,say more than a hundred, youprobably don't want to be doing muchassembly. <S> You need to save your timefor future product development! <S> How many surface mount componentsare on the board and <S> can you reducethat number more. <S> Yes you can soldersurface mount chips in your houseand <S> there are tons of cool methodsfor simplifying that process butstill, nothing beats the speed andprecision of a machine. <S> (If you wantsome tips on how to solder surfacemount chips ask that in anotherquestion. <S> I have found some verygood techniques) <S> Anyways, thru-holecomponents are obviously way easierto solder by hand and if you aregoing to be doing more than a fewboards and actually selling them tocustomers they are a lot easier donot screw up. <S> Do you enjoy circuit assembly. <S> Youneed to consider what you likedoing. <S> If soldering boards all daygives you jollies <S> and you have thetime <S> then maybe you should go forit. <S> But if you are also interestedin design and development of newstuff than you may not want to betied down with your soldering ironall day. <S> Whatever you end up with, Good luck! <A> I would start by ordering 10 .. 100 PCBs, soldering maybe 10 by hand, and start selling. <S> Meanwhile, get a quote from an assembly house for maybe 100. <S> From the rate at which you sell the systems (hand-soldered) <S> you can decide on your next action. <S> If the sales are disapointingly low you don't have lost too much money. <S> If they are high you have soldered obnly a few yourself. <S> Both ways you win (or don't loose too much). <A> Don't forget the marketing! <S> Apart from the hardware assembly and manufacturing side of your project, you may also wish to consider how to market your product earlier in the piece. <S> If it really turns out to be as good as you expect, having one of the review forums like hackaday or hacked gadets review the product will help you achieve critical mass a lot faster and move the product out the door. <S> As you are a student and investing in 50-100 built units is going to cost you a serious chunk of change. <S> Once they are built and have them sitting on the shelf isn't going to get you a good return on investment. <S> So you need to be just a bit clever about the way you intend to sell your product. <S> Think about what support or other options you might also provide purchasers with. <S> Building a logging device is probably one of those things which would probably benefit from regular firmware updates to improve or add features to the logging. <S> (Bug fixes even!) <S> Make it easier for purchasers to access this info and update their product. <A> I would ask for a quote from a shop. <S> Yes, it's obvious that it's going to be more expensive than doing it yourself, but at 100+ it may be worthwhile. <S> How much is your own time worth to you? <S> You already said you don't enjoy it too much. <S> If you're soldering manually it will probably show, and that's BAD! <S> Your customers won't appreciate it and most likely you'll lose them after a first sale. <S> Plus they're not going to recommend you to their 1000 Facebook contacts, and you'll be up to an impossible-to-win marketing battle. <S> Non-professional looking products are only accepted if the price is Real Low. <S> So low that it may not be interesting to you. <S> ( <S> The Chinese have professional-looking products real cheap, so you're up against them as well.) <S> Just to say that it is probably a good investment it to spend some money on quality.
Blogging the process, twittering, tumblr'ing will hopefully get you a bit of a following and make it just that much easier to sell some product.
Building a intermediate op-amp I'd like to build a cheap and easy op-amp to use with my electric guitar. The op-amp should input from the guitar's jack and output to a standard "earphone's cable" jack ( not sure about the jargon here ). So that I can plug it into my Hi-Fi's aux channel, or my PC, or just listen on my earphones. A 9v battery would be the preffered power source. Where can I find schematics for a projet like this? Also, If I wanted to extend the op-amp to handle basic effects, ( Distortion, Feedback, etc. ) How would I achieve that? <Q> I don't think you want to build an op-amp. <S> An op-amp is an electronic component that you usually buy already-made and build other things with. <S> A typical op-amp IC looks like this: <S> I think what you want is to build a headphone/line amplifier with an op-amp. <S> There's a popular guide here: http://tangentsoft.net/audio/cmoy-tutorial/ <A> Wow.... <S> there's so many choices out there, it can be hard to pick one! <S> A great way to get started is to get a breadboard , buy all the stuff you need to make a simple looking amp, (there's a few single chip circuits on that link also) and just have a good experiment with it :) <S> You can do stuff with a 9V battery quite safely, just get some audio jacks soldered to some wires <S> and you can hook up your guitar and stuff. <S> Distortion and feedback are a natural progression from amp design, you'll get into that quite quickly I'd imagine, it's not a big leap in complexity - it's normally just changing a few component values. <S> this site is also great, lots of great stuff for guitarists -> Beavis Audio <A> I'm guessing from the description, you are not looking to build an op-amp but rather an amp (ie without the op part) <S> you might start with something like the cmoy headphone amp. <S> google for cmoy kit. <S> Some of the kits you find may or may not have a volume knob <S> but once you have a gain that works, the stereo could adjust from there. <S> This would be a good starting project that is nice to have and <S> it will also teach some of the basics.... <S> like what an op-amp is. <A> There is a project about a practice board in the General Guitar Gadgets website.
A good place to start is with the Elliott Sound Products website, there's a heap of different amplifier designs for all manner of applications, and there's also different levels of difficulty too.