source
stringlengths
620
29.3k
target
stringlengths
12
1.24k
Budget alternative to fancy linear slide I have been checking out nice 1D linear slides such as this and this and this . Especially the first one is really nice since it has a built in encoder and a controller with RS232 interface. However, the downside is that these have a starting price around $1,700. The specs should be something like: 100 mm travel 1 mm precision Encoder RS232 / USB interface Speed is not critical The load will not be large (<5N) Does anyone have any suggestion how you could do this on a budget of say $500?Or does anyone have a suggestion for something completely different with the same function? <Q> You could possibly salvage the mechanism from an old printer. <S> The print head is normally carried using a toothed belt and small motor with some type of encoder feedback. <A> Take apart an old inkjet printer and use the slide that controls the printer head. <S> Just remove the print head and install a plate. <S> A lot of the folks making 'open source' 3D printers are using this approach, you can probably even find some drivers for the stepper motors in particular models if you look around on their sites. <S> There are several projects doing this <S> so I'd just google "open source 3D printer" for more information. <A> 1 mm precision (±0.5-mm) is not very precise for this type of tool. <S> As you can see the linked examples are ±12-µm and ±15.29-µm. <S> This means you can go with something cheap: <S> alibaba.com . <S> I found this : Precision Motorized Translation Stages , from Beijing Shinhe Optical And Electrical Equipment Co., Ltd. . <S> It looks like the DYT102 is the smallest that fits your requirements (100mm). <S> They claim 8.12-µm resolution, 127-µm repeatability, and 15-kg maximum load. <S> It is $650 : <S> Tyler Lucas: <S> Hello. <S> How much is the DYT102 Motorized Translation Stage? <S> (2010-12-13 13:34:51) <S> Jason Zhang: the unit price of DYT102: $650/p, for your reference (2010-12-13 21:00:44)
If you want a more off the shelf solution, the MakerBot folks use a moving platform and i believe they sell the parts individually.
Problems with PIC A/D conversion I am trying to read analogic signal for a sort of mouse with a pic18f14k50 controller. Here the simple circuit: http://dl.dropbox.com/u/14663091/schematiconew.pdf . I have to read analogic signal from AN9 circuit port. Main function reads from the port, and blinks 30 time if threshold is reached: void main(void) { InitializeSystem(); #if defined(USB_INTERRUPT) USBDeviceAttach(); #endif while(1) { if ((USBDeviceState < CONFIGURED_STATE) || (USBSuspendControl == 1)) continue; if (!HIDTxHandleBusy(lastTransmission)) { int readed = myReadADC2(); //Here i tried both myReadADC2() or myReadADC1() if (readed > 40) { //If read threshold > 40, blink led 30 times int i; for (i = 0; i < 30; i++) { Delay1KTCYx(0); mLED_1_On(); Delay1KTCYx(0); mLED_1_Off(); } } lastTransmission = HIDTxPacket(HID_EP, (BYTE*)hid_report_in, 0x03); } /* [Ed: added] */ }//end while}//end main I used two method to read from the AN9 port, myReadADC() that uses OpenADC() API method: int myReadADC(void) { #define ADC_REF_VDD_VDD_X 0b11110011 OpenADC(ADC_FOSC_RC & ADC_RIGHT_JUST & ADC_12_TAD, ADC_CH9 & ADC_INT_OFF, ADC_REF_VDD_VDD_X & ADC_REF_VDD_VSS, 0b00000010); // channel 9 SetChanADC(ADC_CH9); ConvertADC(); // Start conversion while (BusyADC()); // Wait for completion return ReadADC(); // Read result} and myReadADC2(), that implements manual read from the port. int myReadADC2() { int iRet; OSCCON = 0x70; // Select 16 MHz internal clock ANSEL = 0b00000010; // Set PORT AN9 to analog input ANSELH = 0; // Set other PORTS as Digital I/O /* Init ADC */ ADCON0 = 0b00100101; // ADC port channel 9 (AN9), Enable ADC ADCON1 = 0b00000000; // Use Internal Voltage Reference (Vdd and Vss) ADCON2 = 0b10101011; // Right justify result, 12 TAD, Select the FRC for 16 MHz iRet = 100; ADCON0bits.GO = 1; while (ADCON0bits.GO); // Wait conversion done iRet = ADRESL; // Get the 8 bit LSB result iRet += (ADRESH << 8); // Get the 2 bit MSB result return iRet; } Both cases doesn't works, i touch (sending analogic signal) port AN9 but when I set high threshold (~50) led don't blinks, with low threshold (~0) it blinks immidiatly when i provide power to the PIC. Maybe i'm using wrong port? I'm actually passing AN9 as reading port? Or maybe threshold is wrong? How can i found the right value? Thank you Here the MPLAB C18 Apis http://dl.dropbox.com/u/14663091/API%20microchip%20C18.pdf . <Q> I think there is a bug in your myReadADC2() sub... <S> try return iRet; instead of return iDelay; <A> I'm not sure touching the input is going to work well. <S> Most of the time, you will need an op-amp to buffer the signal into the PIC, unless your signal is naturally low-impedance. <S> Read the datasheet carefully. <S> It would be nice if datasheets put known limitations and gotchas is large bold print, but usually they are hidden in footnotes and electrical characteristic tables. <A> Add a connector for ICSP/debugging, and use a PICkit or ICD 3 for debugging your code. <S> You can then concentrate on getting the ADC working, and then sort out the USB code. <S> You will find things much easier if you use the Microchip ADC code in their libraries. <A> Your schematic seems to indicate that nothing is connected to pin 9, which happens to be AN9. <S> Could you, at least temporarily, put a button with a pullup resistor -- identical to the one you already have on pin 5 -- so we know that the pin actually is being pulled high and low?
The PIC ADC has a surprisingly low input impedance.
After the PCB is designed, what do I need to check in the Gerber files? As and after the PCB is designed, I check it using the native CAD tools. What do I need to check to make sure the generated Gerber files are ok? <Q> The main point for me about looking at the Gerbers outside my primary CAD is to make sure everything looks OK. <S> I put a lot of trust in my main CAD package, and use the Gerber viewer as a qualitative verification. <S> Things I look for: All layers are aligned All layers are present (file exists) <S> All layers have data (not just vias) <S> Board outlines have the correct dimensions <S> Fill polygons have the right isolation, orphan settings <S> Make sure your soldermask is correct near high-density parts (tented vias, etc.) <S> Making sure that Eagle merges the layers correctly is my biggest worry when I'm checking the Gerbers, because if you aren't using a 100% verified CAM flow, what you see on the page might not be what you get in the Gerbers. <S> Other than that, everything should be the same. <S> Think of it as looking at a printer's proof before ordering a lot of copies. <A> If you have the components on hand already, print the outer layers out at 1:1 and place all the parts on there. <S> Ordering parts and boards at the same time is a little faster, but this would have saved me a couple board respins. <S> Your layout software should have checked the design rules. <S> It's unlikely you'll find design rule errors on the gerbers that the PCB software missed. <S> On the other hand, using gEDA-pcb's photorealistic rendering output , I've caught a few errors before fab, mostly soldermask. <S> Your fab will have a checklist of capabilities on their website. <S> Go through this line-by-line. <S> EEVblog <S> #127 discusses such things as panelization and fiducials. <S> Worth watching, especially if you are designing for machine assembly. <A> A few gotcha's: Mirrored/Rotated Layers: Make sure that the top and bottom layers are oriented the same way. <S> Gerber vs. Drill alignment: Sometimes, the drill holes and the Gerbers will be grossly misaligned. <S> Perhaps the gerbers are centered on the origin, and the drills have their bottom left corner at the origin. <S> Font not rendering correctly: Unlike your PCB editor, Gerbers don't have a font library. <S> This may only show up as a difference in character widths, which may or may not cause trouble. <S> These are easy to see in a Gerber viewer like GC-Prevue, but hard to detect in your export settings. <A> Check them with a Gerber viewer, I use GC-Prevue . <A> In addition to manually checking the gerbers as well described above, I also like to send the gerbers through an external checkers to ensure that my design rules were correct. <S> There are many of them, mostly free. <S> If you're really paranoid then send it through more than one service and compare results. <S> A quick Google search for "dfm check" resulted in these three but there are others. <S> I mainly use the first <S> but I have used others. <S> - <S> freedfm.com - <S> smartdfm.com - betterdfm.com <S> When you get their results, go back into your gerber viewer program and see if you can spot the errors. <S> That way you'll know what to look for when you view your gerbers the next time. <A> I use ViewPlot to view my gerber files generated by Eagle. <S> Mainly, what I'm looking for is that my silk screen is all there, and that my drill holes line up with my solder mask. <S> Specifically for the silkscreen, if you look at the assembly drawing only, that can be there but not present on the silkscreen layer <A> Check that the layers are all present and numbered correctly. <S> This can be a problem when adding, deleting, or reordering layers to a design. <S> Check inner layers for missing pads. <S> Check the notes. <S> Check the stackup, including controlled impedance requirements. <S> Check for thermal relief, if desired. <S> Are the pin 1 indicators visible, even when the parts are installed? <S> Does the CM need panelization? <S> If so, does it meet their requirements, such as rails on the sides? <S> Fiducials present for the PCB and BGAs (and panel) and they meet the CM's requirement. <S> Make sure copper or silkscreen has the bare board part number and revision. <S> Are the Gerbers in the zip <S> files those for the board designed, for the latest revision? <S> This can be an issue when the Gerbers were generated, an error in the design found, but the Gerbers weren't regenerated. <A> In addition to all the good answers, I would suggest doing a 1:1 scale print, double sided if possible, to check component dimensions, board dimensions, writing orientation, drill sizes, clearance for for container if any. <S> Few mistakes I have made in the past. <S> Drill holes for resistors too small If you can someone else to question your design it would also be a plus.
An easy way to do this is to check that the soldermask for the top and bottom line up on a few through-hole vias and pads. Make sure to use a vector font, which can be defined as a series of vectors in the gerber, rather than a proportional font, which might be different (and may not) on the gerbers. Mirrored text Slightly wrong footprint for a specialized component
Proper soldering iron wattage for working with uP scale electronics? I need to solder some headers onto an Arduino shield - what's the recommended wattage for working on that scale? I ask because the shield is already populated with ICs and I don't want to burn them out. <Q> Selecting an iron that is too low in wattage requires the user to apply heat for a longer amount of time. <S> This actually makes the surrounding area heat up more than if a more powerful iron were used to heat the component. <S> Although a 25W iron will likely do this job without any trouble, and 80W temperature controlled iron is much more versatile. <S> Make sure you use flux, and tin the iron afterwards. <A> I use Metcal equipment and they recommend a tip roughly the same size as the item being soldered, for optimum heat transfer. <A> You generally want the biggest iron that still lets you work on the parts easily. <S> You then want to put the biggest tip on the iron that still lets you work on the parts easily. <S> Overall power is not important, really. <S> The critical factor in a soldering iron is the instantaneous heat capacity, e.g. how rapidly it heats up what it is in contact with. <S> Basically, a slightly too hot iron is better than a slightly too cold iron. <S> Basically, if you can make each solder joint quickly, less heat is conducted up the leads of whatever component you are soldering, to the IC die. <S> Basically, there is a non-trivial amount of thermal resistance between the IC pins and the die. <S> Therefore, the pins spending 10 seconds at 600F is worse than 5 seconds at 750F, since the internal temperature effectively follows the same curve as a RC filter. <A> To add to the other answers, I would be cautious if you're soldering on a board where you have an internal power/ground plane or some other sea of copper. <S> Remember that the more copper your pin comes into contact with, the more heat dissipation will occur and the longer you need to heat the pin before the solder will flow properly. <S> I haven't creamed a chip this way <S> but I have noticed my board makes a nice temporary hotplate after soldering around copper planes. <S> Conversely this may bite you if you then turn to pins hooked up to normal traces and use the same technique to solder those pins in that you did with the power/ground plane pins. <S> Also when soldering fine pitch parts (like a QFN package) I find solder-wick invaluable. <S> That way I can allow some amount of bridging between pins and 'soak-up' the excess with the solder-wick. <S> Usually I find the solder-wick will definitely soak up the bridge and leave just enough to make a connection between pin and pad which I either leave or touch up with a little additional solder.
The correct choice is a sufficiently powerful temperature-controlled iron (50W, say) set to the right temperature for the solder used, with an appropriate size tip.
How to make a simple daylight on-off switch? I have a project planned where I want for some LEDs to turn on when it's dark and turn off when it's light. I have some transistors, diodes, and a photoresistor(and of course other basic components). The photoresistor has lower resistance when in daylight though. How do I 'NOT' this so that I can turn something on when it's night instead of daylight? <Q> evil mad scientist did a great write up on LED throwies, should give you a good place to start http://www.evilmadscientist.com/article.php/nightlight <A> If you use the photoresistor in a voltage divider (i assume you know what that is) <S> to supply the base current of the transistor, you can achieve your aim. <S> When the resistance of the photoresistor is lower (daytime), more base current flows to the transistor and turns it 'on' (it's best to use a variable resistor for the second part of the voltage divider). <S> if you look at the below image, when enough current (controlled by both resistors) flows at point A, the transistor will turn on and drive whatever load you put on it. <A> Ultimately, you're going to take the output of the photoresistor and convert it into a logic high or logic low, which turns your light on or off. <S> If you need to flip this, one simple way is to take the digital output (assuming you are using a comparator) and pass it through an inverter, like a 74LS04 or equivalent. <A> Funny you should ask .... <S> I just finished building one of these circuits for myself. <S> I wanted a circuit that would do what you asked for <S> but I also did not want things like car headlights turning it off for a while as they passed by, or having a passing cloud going by turn it on during the daytime. <S> My solution was to use a 555 timer chip and put the photosensor (I used a phototransistor but a photoresistor will work too) as part of the timing resistance. <S> I was going to post the circuit diagram <S> but they only let you attach images here if they are already on a web page somewhere. <S> Anyway, I'll try to describe it. <S> On the 555 timer you tie the Trigger and Threshold pins (pins 2 and 6) together and from those pins put a 100 microfarad capacitor to the negative side of the DC power supply. <S> Also from those pins tie a variable resistor (I used 250k) to a fixed resistor (I used 50k) to the negative side of the power supply. <S> That way the variable resistor will change both the charge time and the sensitivity to light. <S> The output comes off of pin 3 of the 555 which can drive a 5 volt relay, or it can drive a transistor, or in my case I wanted to control a light that runs 120 volts AC <S> so I had the 555 output drive the LED inside of an optotriac (a MOC3021) <S> and then the optotriac drives a larger triac (a BT136-60) that can handle up to 5 amps. <S> Since a 555 can run on any voltage from 5 volts up to 15 volts I used a 12 volt DC power supply to power my circuit. <S> But you can use any voltage within that range. <S> Also since I used a phototransistor but you are using a photoresistor it is virtually certain that you will have to adjust the resistor values to suit the range of your photoresistor. <S> The cost of the parts in the light sensor were $1.22 for everything except the 12 volt power supply. <S> The power supply cost me $5.60 <S> I really wish I could have uploaded a PDF of the circuit diagram.
Tie your photoresistor from the positive side of the power supply to the wiper on the variable resistor.
How do I set the clock speed fuses on an ATtiny85 when using an Arduino as a programmer? I'm following this tutorial , programming the ATtiny85 with an Arduino, using it to play some tones (through a piezo speaker). I'm struggling with getting the tones at the right pitch (I'm creating the wave forms manually, as the tone() function is unsupported on the ATtiny85). I believe the problem may be down to differing clock speeds on the Arduino and ATtiny. I understand the clock speed can be altered on the ATtiny, how do I accomplish this using the arduino environment? <Q> I'm using Arduino UNO + ArduinoISP successfully. <S> Add -U flags to your avrdude command to set any or all of the three ATtiny fuses. <S> avrdude -p <S> attiny85 -P <S> com8 -c <S> stk500v1 -b <S> 19200 -U lfuse: <S> w:0x6f:m <S> -U flash: <S> w:main.hex <S> The clock selection is done in bits[3:0] on the third fuse ('Fuse Low Byte'). <S> Set them as follows to make use of an external crystal (of 8MHz or faster): -U lfuse:w:0x6f: <S> m Its definition (I infer) must be something like: [Fuse Low Byte]:[write]:[hex value]:[set manually] <S> The default value for the four high bits of this byte are 0110 , so leave the 6 in 0x6f as it is, and only change the second digit, the f (its default value is 2 ). <S> NB: If your processes take longer or shorter than you expect, check your clock prescaler and your definition of F _ CPU. <A> Try using the related tutorial by the same group (MIT's High-Low Tech) entitled Programming an ATtiny w/ Arduino 1.0 . <S> A quick summary: From the Tools-> Board menu in the Arduino IDE, select the ATtiny85 and the frequency you wish to run at (1 or 8 Mhz internal clock, or 20Mhz external crystal) and then use the Tools - <S> > Burn Bootloader". <S> I believe selecting the desired speed board modifies the way <S> the delay() and other time-related Arduino functions work in order to sync up with the clock speed. <S> I have had success with this approach myself using some ATtiny84 chips. <S> The simple blink program is fixed, as well as more sensitive timing required for manually controlling pulses sent to a servo using delayMicroseconds(). <A> I believe the Arduino software (libraries and all) assumes you are operating at 16MHz. <S> If you apply that assumption to the clock you are actually running at... things should work out. <S> Assuming you are running the Tiny85 on it's internal oscillator I think it runs at 1MHz <S> , so just multiply all your delay statements (and other notions of time) by 16. <S> If you need better accuracy than the internal oscillator provides you should think about using an external crystal or a resonator, but you will need to change the fuse settings of the AVR for that to work, and I think you will need a programmer like the AVRISP mkII to do that with AVR Studio (my recommendation). <S> I don't know much about the ArduinoISP sketch but to me it looks like it bit bangs the ISP protocol to upload a program to the target chip (not the on board Mega328), not sure it is equipped to manipulate fuses. <S> ArduinoISP is documented here http://arduino.cc/en/Tutorial/ArduinoISP , fwiw. <S> Note that you can't use a UNO currently to run the ArduinoISP sketch. <S> It doesn't look to me like you can use the sketch to make the Arduino a viable interface for using the AVR Studio GUI tools. <S> EDIT : <S> It looks like stuff has caught up and an UNO is viable for ArduinoISP <S> now - thanks for the comments all <A> It appears you are using ArduinoISP, try using AVR Studio or the command line options for avrdude . <S> Depending on how the ArduinoISP was written, it may function just like an Atmel AVRISP mkII or similar. <A> Default fuse settings for the ATtiny85 are: lfuse 0x62, hfuse 0xdf, efuse 0xff. <S> This uses the internal RC (8 MHz) oscillator with "divide by 8" so clock is 1 MHz. <S> See http://www.engbedded.com/fusecalc for more fuse settings. <S> You can still use avrdude directly to change fuse settings of your ATtiny85 even when using an ArduinoISP as the programmer. <S> If you do end up manually changing fuse to alter the clock, be sure to edit the attiny85.build.f_cpu line of your [arduino_folder]\hardware\attiny45_85\boards.txt file. <A> Never tested it myself. <S> The tutorial explicitly says you can use the Arduino UNO and I have tested it and worked, so I can confirm that, so the ArduinoISP page is outdated and the UNO warning should be ignored. <S> If your UNO was one from the first batch you probably have a faulty bootloader, you will need to reflash the bootloader. <S> Check this page for more information (ignore the serial numbers, all my UNOs were not from that series and had problems). <S> The ported core libraries you downloaded from the tutorial are written to use the 1MHz internal oscillator (confirmed from boards.txt file), so maybe the timming problem might be in the ported core libraries or in your code. <S> Kind regards <A> Choose an ATTiny board from "boards manager" that includes the ATTiny85.This <S> is in the "Tools" Menu. <S> I think this includes "16MHz internal PLL" now.(You can install one from http://drazzy.com/package_drazzy.com_index.json ) Select ATTiny85 explicitly if required. <S> Choose a clock. <S> Until you know more, choose an internal clock. <S> Click <S> "Burn Bootloader" as a Menu Item. <S> Caution, you may no longer be able to program the MCU if you choose very low values. <S> If this is your intent, do this last unless you have spares or an High Voltage Programmer to reset the fuses.
I think you can set the fuses with the ArduinoISP, but not with the Arduino IDE but with avrdude, check this link .
Using 2 outputs on an arduino to drive a motor I have a small motor which I removed from a mobile phone. I want to control it from a digital output on my Arduino board. Will I damage it if I connect the motor directly to to the board and it needs more power? Can I use 2 outputs of the Arduino together? I know the best way to do this would be to use a transistor as a driver but I'd really like to avoid it since I don´t have it on stock and it is cold in Copenhagen now. <Q> You need a suitable driver, like a BJT or MOSFET. <S> Use an L293D if the motor is to operate bidirectionally. <A> What is the current requirement of the motor? <S> If it's less than 60mA, you can probably get away with sinking the current. <S> Be aware that some digital pins can sink more current than they source. <S> At 60mA, you will still be at 1.5V out (so watch your power dissipation!), but you won't get far at all trying to source that kind of current. <S> 40mA is a generous maximum for sourcing. <S> Therefore, you should connect to the negative terminal of your motor. <S> A <10 ohm resistor on each output should help them to share the current more evenly. <S> Try to split shared outputs between different ports on the microcontroller, because this will separate the heat on the chip. <S> This has the drawback that it takes more time to set multiple ports, so try to avoid doing read/write/modify if you can help it. <S> Finally, as Joby noted, don't forget a diode. <S> Edit: I'm assuming this is a simple DC motor, and you want to operate it in one direction. <S> If you have anything more complex, you should brave the cold and get yourself a proper driver. <A> The problem is the motor's current requirement, it's likely about 70mA which is much more than can be safely drawn from an AVR pin. <S> You can probably scavenge a transistor from the mobile phone where you got the motor. <S> Don't forget to add a diode to protect from the back-EMF too. <S> (If you're looking for an easy motor to interface with Arduino, consider micro servos - these require no other components) <A> Check the datasheet for the particular AVR chip you're using. <S> Some modern MCUs have a high current source/sink (I seem to recall the PIC 2550 having a pin able to source <S> /sink 50mA) <S> pin that can be used to directly drive an LED, for example. <S> It might be enough for the motor if its current requirements are low.
If you need to use multiple outputs together, be aware that the transistors in those outputs will likely have subtle differences, and not share the current very accurately.
How to wire a potentiometer to an ADC for low power I'm designing a microcontroller based device which spends most of the time in deep sleep.Every 10 seconds it wakes up, reads a potentiometer connected on an ADC line then goes back to sleep. My aim is to achieve a long battery life. How should I wire the potentiometer up to the microcontroller in order to minimise power use? For my first attempt, I wired a 1K pot to 3V3 and GND with the wiper attached to the ADC. No matter what resistance is set on the pot, this seems to consume 3-5mA continuously. Should one or more of the pot pins be connected to GPIOs and driven only when needed?If so, should the pins be driven low or tristated when not in use? <Q> Your 1k pot is causing most of your quiescent (standby/off-state) current: <S> I=V/R, and you've got 3-5mA and 3.3V/1000 <S> = 3.3mA. <S> You can either connect one side to a GPIO pin and drive it only when needed (as you suggested) and/or use a larger pot. <S> Be careful when using very large pots (1M and higher), as the input impedance of your A/D pin might cause a slight variation in the voltage you read. <S> This may or may not be significant for your project. <S> I'd compromise by using a 100k pot and connecting one side of the pot straight to ground, and the other to the source of a P-channel MOSFET. <S> Connect the center to your A/D pin, and the MOSFET gate to the microcontroller. <S> That way, you can allow the microcontroller's weak internal pull-up resistor to bring it to 3V3, and dissipate minimal power. <S> An additional power savings might be to add a constant voltage divider to your circuit (and an additional A/D line), and run straight from the batteries, eliminating the voltage regulator and its quiescent current requirements. <S> Also, you might want to run the numbers and see what kinds of battery life you get with quicker pulses. <S> Even if you slow your microcontroller down to 100kHz or so, you can probably take an A/D reading in a millisecond. <S> Ten seconds between pulses gives you a duty cycle of 0.01%, which isn't that different from 0.1% or 0.3% for many applications. <S> I'd speed it up to take a reading every 300ms or so to avoid having users resetting and otherwise fiddling with the device when it doesn't respond instantly. <S> On second thought, I'm assuming a human is turning the pot, which may not be the case. <A> Connect the midpoint of the pot to an ADC input, with a significant-value cap to ground. <S> If you have multiple pots and can't afford to use three processor pins for each one, you could e.g. use external chips to connect and disconnect the ends of the pots. <S> Note that the ends of the various pots should not be tied together; when a pot is disconnected, it should not connect to anything else. <S> If you do things this way, the ADC input voltage, with its cap to ground, should remain roughly constant when the pot is connected and disconnected. <S> When powering up the cap, take readings repeatedly until either they stabilize or it becomes clear they won't (because they go up and down, rather than asymptotically approaching some value). <S> If there isn't too much leakage in the circuit, you shouldn't have to have the pot powered up very long if it isn't being moved, since the cap should start out at, and remain at, the proper voltage. <A> Instead of connecting the high end of the potmeter to +3V3 you could connect it to an I/O pin. <S> Before going in sleep mode set the pin to input, so that there's no current running through the potmeter. <S> (The resistor keeps both the high end and the wiper at ground.) <S> When the uC wakes up set the I/O pin to output and set it to high level. <S> Though 1K may not be a problem -- you'll draw 3.3mA from the output pin -- <S> I suggest you take at least a 10K potmeter.
I would suggest wiring both ends of the pot to port pins that can be configured not to burn quiescent current while sitting at half-rail (many processors have pins that can be configured to be either digital outputs or analog inputs) and float both ends of the pot while not taking readings.
How close can I place 0603 resistors? How close can I place two 0603 resistors on a PCB? <Q> I have a silk layer bounding box of 2.6mm x 1.4mm around the pads of 0603s, and I often place resistors with touching bounding boxes. <S> Lengthwise placed next to each other <S> this leaves 0.2mm between pads. <S> For reflow soldering this has never caused problems. <S> For wave soldering you will need more space, esp. <S> in the wave direction. <S> For hand soldering it depends on the soldering skills of the person who assembles the board. <S> 0.2mm may be possible if you don't use too much solder. <S> While 0.2mm may look like very tight, remember that this is reflow soldering. <S> When the solder paste melts it's capillarily drawn to the contact surfaces of the resistor, so it won't flow to adjacent pads. <A> They save a lot of space. <A> This can vary a lot. <S> Fab <S> How is it being soldered? <S> By hand or pick and place? <S> What fab house are you using? <S> What are their requirements? <S> These are things you should ask yourself and get answers for in order to determine how close is possible for the fab process. <S> Signal Integrity <S> You will also need to look at what signals are on each resistor. <S> When you have high speed lines you can have issues. <S> Also if you have high voltage you can have issues. <S> I know this is rather broad. <S> If you have a specific case I will be willing to add more. <A> From here "The document is "IPC-7351A Generic Requirements for Surface Mount Design and Land Pattern Standard". <S> You have to buy it from www.ipc.org. <S> " <S> You CAD package may have it already. <S> There are 3 variantes, so you would use the "least" (i.e. smallest one). <S> "If you want to look at the recommended footprints, without buying the standard, you can download a free viewer at: http://landpatterns.ipc.org/default.asp <S> There's more info available at: http://www.ipc.org/ContentPage.aspx?pageid=4.6 "
If you need several resistors with the same value as close together as possible, use resistor arrays instead of individual parts.
Can I merge two impedance matching circuits? I've got an RF transceiver (Nordic's nRF24L01+) which shows a typical circuit to match its antenna output to a single ended 50 ohm impedance. I've also got a chip antenna which comes with an example circuit to match a 50 ohm line to the antenna feed point. If I am going to place the transciever and the chip antenna very close, then there is no need for a 50 ohm transmission line right? If so, can I somehow merge those two matching circuits into one and thus reducing component count? <Q> I'll take a shot at this one as I'll be doing the exact same exercise for my work soon. <S> So the antenna impedance appears to be 60-j21 ohms: <S> And the impedance looking out into L3 is 31-j7 ohms: <S> (This would imply a source impedance of 31+j7 ohms). <S> So how can we get from 60-j21 to 31-j7 ohms? <S> A two-element matching network can do it. <S> Here are a couple possibilities: <S> So the two two-component possibilities are high-pass (series L, parallel C) or low-pass (series C, parallel L). <S> If the matching network is used as a filter for harmonic suppression, then the low-pass form is preferred. <S> On the other hand, the 24L01 outputs have a DC level at the power supply voltage. <S> If you don't want DC on your antenna, a topology with a series capacitor for DC blocking may be desirable. <S> If the matching network is being used for filtering, it is desirable to be able to set the Q of this filter to get a steeper shape factor. <S> Two topologies for this are the "PI match" and the "Tee match." <S> Essentially they are two back to back two-element networks, matching to an intermediate impedance to set the desired Q. (to be continued) <A> Yes, you can, but you probably don't want to. <S> There are second order effects of the components that you have to be aware of. <S> For example ESR (Equivalent Series Resistance) in caps. <S> These caps are small and cheap, so I would look to save area/components elsewhere. <A> You should be able to do that. <S> On the Antenna side, looking into that 2.2pF cap you should see 50 Ohm. <S> On the transmitter side, you should see 50 Ohms looking in to the node between C5 and C6. <S> Now, this might be a little narrow band, and require some tweaking, but you should be fine. <S> I'd do some tweaking at the antenna range to make sure you got the range you really wanted, though.
All that's necessary to make a match is two components.
Ambient operating temperatures for *duino boards If this has already been ask I apologize as I cannot find it using the search option, please send link. For my first project I'm thinking of building a monitor, in stages, for my outdoor pond (about 30 feet from the house) with wireless data transmission for various conditions like water level, waterfall pump failure, icing, and maybe even the occasional Heron that likes to feed on my Koi. I'm also leaning heavily towards the Netduino board as I would like to leverage my C# skills. Anyhow, when I look at the specification for the Netduino board, it specifies an operating temperature of 0 to 70C. Right now it's -8C outside and will probably go to -13C tonight. The coldest I ever remember it being here (Rochester NY) is maybe about -28C (-18F maybe -20F) but that is very very rare. The Arduino site lists no specific temperature specification, but links to the Atmel specification. The Atmel processors ( ATmega328 and AT91SAM7X512 ) for both both boards are rated from -40C to +85C; well withing my requirements. So the question is, can I also assume the Arduino board is also limited to some range less than the microcontroller? What board factors might limit the temperature range for such a project? Thanks <Q> Well, my first guess is that temperature operation would be limited by the oscillator. <S> Now, I'm flying completely by the seat of my pants here, as I haven't looked at the parts on the Arduino. <S> If you pull the specifications on the parts, my guess is that the oscillator is the part with the most limited range. <S> Typically, the bigger the temperature range, the more expensive the oscillator. <S> The other factor that may come into play is the frequency offset. <S> As the temperature shifts, the oscillator frequency will shift as well. <S> For a wireless system, this may mean that the transmitter/receiver frequency will shift as well, possibly enough to make the range decrease. <S> Dave <A> This would apply to everything in your system, from the water level sensor to the wireless transmitter. <S> Some parts are harder to find based on markings. <S> I wouldn't worry too much about resistors and capacitors. <S> Most manufacturers won't tell you what happens when you exceed the temperature ratings. <S> I'd recommend you take your system and put it in a cooler full with dry ice, and see what happens. <A> Most electronics will still operate at temperatures lower then their rating, it's just that they may drift outside their specifications. <S> Wireless communications would be the only thing that would be fairly sensitive to this; the tolerance on most wired embedded communications is fairly loose. <S> What I would be more concerned of besides temperature is condensation on the board. <S> If you put the Arduino into a relatively enclosed box in your warm house then take it into the freezing cold, all the excess moisture will come out, possibly onto your board. <S> Despite me being "more concerned" about this, my level of concern would still be very low unless you're doing high precision analog readings or the like.
If you can't identify the exact parts used on the Arduino board, you aren't going to be able to verify that the Arduino/Netduino board is rated for those temperatures.
Why is there such a strong preference for 45 degree angles in PCB routing? I've always wondered this: every single modern PCB is routed at 45 degree angle increments. Why does the industry prefer this so much? Doesn't any-angle routing offer more flexibility? One plausible theory would be that the existing tools only support 45 degree increments and that there isn't much pressure to move away from this. But having just researched this topic on google, I stumbled across TopoR - Topological Router - which does away with the 45 degree increments, and according to their marketing materials it does a considerably better job than the 45-degree-limited competitors. What gives? What would it take for you personally to start routing arbitrary angles? Is it all about support in your favourite software, or are there more fundamental reasons? Example of non-45-degree routing: P.S. I also wondered the same about component placement, but it turns out that many pick & place machines are designed such that they can't place at arbitrary angles - which seems fair enough. <Q> Fundamentally, it basically boils down to the fact that the software is way easier to design with only 45° angles. <S> Modern autorouters are getting better, but most of the PCB tools available have roots that go back to the DOS days, and therefore there is an enormous amount of legacy pressure to not completely redesign the PCB layout interface. <S> Furthermore, many modern EDA packages let you "push" groups of traces, with the autorouter stepping in to allow one trace to force other traces to move, even during manual routing. <S> This is also much harder to implement when you aren't confined to rigid 45­° angles. <A> See https://sourceforge.net/projects/liquidpcb/ <S> It's an EDA CAD package I was writing, but developement slowed a lot when I had kids. <S> It does not support straight tracks at all. <S> All tracks are freely curving and take the most optimal routes to their destinations. <A> It looks more tidy, and enables the most tracks to be put into a given area. <S> it's also better for controlled impedance tracks. <A> I don't think there exists such a strong preference for 45 degree angle. <S> I have seen an old Tektronix Oscilloscope (Tek 2213 to be precise) board with traces that looks like hand drawn :-) <A> This predates any issues with PCB software and routing: The three main reasons we were given in electronic engineering classes in the late 1970s were: 1) <S> The 90 degree inside and outside corners make that area more susceptible to problems where the etching process eats underneath the trace. <A> Another thing to consider is that it makes Gerber files smaller. <S> Gerber files define a series of lines (among other shapes). <S> e.g. <S> To draw a true circle in a Gerber file takes hundreds (thousands?) of lines. <S> But to draw an octagon takes only eight lines. <A> For my own PCBs I like rounded & curved tracks, no problems there as long as you are routing manually. <S> In most of industrial PCBs <S> it's just a tradition due to limitations on early/current routing software. <S> Less sharp angles = <S> /*marginally <S> */ <S> better signal quality. <A> The primary reason is that it makes for an easier problem set, and can be easier to design. <S> There are some useful properties that a 45/90 degree system provides. <S> The primary reason I'll say is that it lets you keep your desired grid spacing without a big penalty. <S> If you start from a point in a grid, each cardinal direction (up, right, down, left) will arrive at an adjacent grid point at 1 unit. <S> Any 45 degree angle will also arrive at an adjacent point, although the distance will be (sqrt 2) units. <S> If you were to use an angle such as 30 or 60 degrees, you would arrive at a midpoint between a grid point, which would require you to have a finer grid. <S> A finer grid increases the computation time for path evaluation and may make it more difficult to cleanly optimize the circuit. <S> The TopoR software uses a completely different algorithm from the typical router, which makes it unique. <S> The PCB designs that TopoR makes looks similar to old hand-drawn PCB layouts from the 60's-70's. <A> I read that historically PCB production machines had only 90/45/0 movements, but most importantly, 45 degree is preferable to 90 degree curves because in the dol times 90 degree turns were prone to deterioration, so it was more likely that a 90 degree turn would lose copper and break the connection... <S> so before software, hardware reason... it's all about history, and legacy <A> The reason is that traditionally (from 60s) <S> mask flashing machines were working with a limited set of blinders and flashes, as well as angles were fixed. <S> Some were not capable of making precise rotation other than 45 deg. <S> The same, software did not allow flash overlapping other than 90 and 45 deg, avoiding flashing wrong corners. <S> Well, and it looks better, making it easier to track down problems.
The sharp outside corner of the bend can cause issues at higher frequencies as the points can act as mini antennas and radiate the signals 2) Because the outside corner of a 90 degree bend is a thin point it can be etched away easily if etching times are not very carefully controlled and so affect the thickness of the trace 3)
What part is like a male header with long pins on both sides? What is the part in the picture below? It's like a male header, but with long pins on both sides. I've got some temperature probes I've built that end in female connectors and I'd like to use something similar to use the probes with a breadboard. I've looked on Digikey under headers and haven't been able to find anything. <Q> The part is available on Digikey with their part number PCC36SFAN-ND: <S> Sullins Connector Solutions PCC36SFAN . <S> A PDF drawing of the connector is available from Sullins. <S> It's just a single row male header. <S> What I've done when the lengths aren't quite right is just order it longer on one end, and then push the plastic bit so it shifts to the middle and leaves equal-length conductors on each side. <A> See these tips on OpenCircuits. <S> In one salvage job I found some"double ended" headers, long pins onboth ends. <S> These can be very handybecause once plugged in <S> they can beused to let you plug in femaleconnectors ( like those on hard drivecables ( but just one of the two sides) to the board. <S> See pictures below. <S> Hard part to find. <S> But wait, you cansolder two regular headers back toback. <S> Expanding on the "double ended" headerabove. <S> Right angle headers are longenough to bend the pins so they arelong on both sides. <S> Take a dual rowone and bend the pins to fit acrossthe gap at the center of the protoboard. <S> Then you can plug in a dualplug like those on hard drive cables <A> If you can still find wire wrap headers, they are a great material to cut up for things like this. <S> But for insertion in a breadboard you probably don't want "full size" (.025" square iirc) pins but smaller diameter ones to avoid damaging the breadboard (unless you are willing to dedicate those rows to this header) <S> If it's only three leads and you have the female socket on the cable, I might personally be tempted to insert three pieces of bare wire in the socket and plug the other ends into the breadboard, then tack the socket down with a wire strap, or hot glue or something.
You could also make up a three wire twisted or braided cable of 22 or 24 gauge solid, insert one end in the socket and cover the joint with heat shrink and run the other end into the breadboard.
Best way to get a low DC voltage from a high DC voltage for a power supply? I have a 200V DC power input and I need to, with no external voltages, generate a 12V-24V voltage to run the control electronics off, at about 50mA. I've considered zener diodes and potential dividers but they waste too much power; the resistor at the top must dissipate 9.4W to provide 0.6W, which is a ridiculous waste and difficult to handle. I've tried to look at how switch mode wall warts do it, but they seem to have some kind of fancy mechanism of powering themselves from the output, which I don't really understand. (Neither do I understand how they initially get a voltage.) <Q> http://www.sparkfun.com/products/10214 <S> While this charger is rated for 100 - 240 VAC, the first thing that a switchmode supply does is rectify the input voltage, so 200 VDC will work fine to power it. <S> (You can of course buy this kind of supply in a variety of output voltages.) <A> This problem is known as bootstrapping. <S> It's even more of a problem when designing low-voltage boost converters. <S> If you've got a .1V 10A source, sure, you've got 1W of power, and could probably generate close to 200mA at 5V from it, but you need a voltage usable for some electronics. <S> A 5V power supply is conveniently and indefinitely available on your devices' output soon after you solve this problem. <S> I won't go into design of bootstrapping a boost converter here (because I don't know how...) <S> but I would suggest how you might go about designing a buck converter. <S> We'll assume that you have a circuit which can generate 12V from 120V when powered with 12V. <S> That's not so hard, there are several designs which could do this. <S> Wikipedia has a simple one, you might look into others in various application notes. <S> If your switch oscillates at a few hundred kilohertz, you should be generating a usable 12V signal in a few milliseconds. <S> What you need, therefore, is a way to generate a voltage to power your device for just a few milliseconds, and then turn it off. <S> A simple resistor/>12V zener diode system with a transistor just after the resistor will be fine. <S> A PMOS with the gate to your circuit's output should switch this source off soon after your regulator starts working. <S> You'll want to ensure that your load is disconnected when starting up, because this could cause your shunt regulator to go out of regulation. <S> Break your problem down into two steps: <S> Generate 12V from 200V while powered from an external 12V source. <S> Generate 12V from 200V for a few milliseconds without an external source. <S> Then combine the two. <S> The first one is arguably more interesting, many textbooks will skip over the second problem. <S> My professor mentioned it as a side note when lecturing. <A> Going with @markranges' suggestion, here's one at <S> Digi-Key <S> that does 85-264 V AC 110-340V DC in and 12 V, 420 mA out. <A> What you're looking for, I think, is a High Voltage DC-DC Converter. <S> Something like those found here: <S> http://www.powerstream.com/dcdc.htm <S> For theory of operation, I recommend reading http://en.wikipedia.org/wiki/Buck_converter and http://en.wikipedia.org/wiki/Switched-mode_power_supply . <S> The short answer to how it gets power is through a feedback circuit. <A> First, are you able to float your controller at +176V? <S> This way you would not have to drop the voltage. <S> I/ <S> O circuitry would have to be fancier. <S> There are two ways to drop voltages: dissipate power (linear regulation) or switch it and smooth the output (buck). <S> Ideally one would draw only 6mA from the 200V line, but there will be losses in a buck converter. <S> I've never seen a HV DC-DC buck made for low power. <S> You may need to make one on your own, if it's worth it. <S> I'm not sure which will have larger losses. <S> How much is it worth? :D <A> The switching mode wall worts are pretty simple. <S> The rectify the input voltage (which you don't need to worry about since you have 200VDC already) <S> then turn it into a PWM waveform at fairly high frequency. <S> The transformer can then be rather small and light weight as its operating at the PWM frequency. <S> The turns ratio of the transformer is used to step down to the desired voltage and then filtered or further regulated as you would with any switching regulator. <S> The feedback loop to the PWM controller (which is operating at mains/high voltage) is usually done with an opto-coupler <S> so there is complete isolation between the high voltage and low voltage sides. <S> You may be able to skip that in your case. <S> What would be ideal is a flyback or a feed forward switching controller. <S> Here are some examples from linear. <S> But your problem is going to be that 200VDC is really high <S> , i've never seen a DC-DC controller that supports more than ~100V input. <S> However, you should be able to adapt an AC-DC switching controller which are normally designed for use with rectified mains voltages which can be much higher than 200V. <S> For instance ST makes a bunch of such controllers . <S> I think that you can use this type of topology with 200VDC with minimal modification although i've never tried, you should study the modes of operation further. <S> I'm sure there are many more manufacturers for similar parts as well. <A> Check out Power Integrations <S> Linkswitch TN devices - these will do exactly what you want with good effficiency and low cost, assuming you don't need isolation.
Other answers have pointed out that you can probably just tap an AC switch-mode regulator after the rectification circuit, but I suspect that you also want to know how it works.
How to check for Stack overflow in an embedded application? I have run into a problem where I believe my stack is overflowing. The reason I am inclined to think this way, is due to the following: 1) Compile code, dump into the device: - no activity from the device (I am expecting an 'I am alive' message) 2) In this situation, I increased the stack size by 10 bytes, recompiled and dumped to the device, and the problem went away. 3) Tried the above two steps 10 times, back and forth, and can reproduce the problem reliably, and fix it reliably. I want to see the stack falling over, how do I do this? I am currently using an M16 Microcontroller, with 2K RAM (30 bytes left), 256 Bytes Stack size. The IAR Workbench that I am using, does not have the call graph utility. Are there other ways to do this - check the stack falling over and by how much in code? Any help will really be appreciated. Thanks! <Q> A common way to check for memory usage is to prefill memory with a constant value before your program runs. <S> eg <S> a sequence of 0xde 0xad could be written out to your stack area by your startup code. <S> During the program's operation, the stack will grow and write over these sequences. <S> If you then have the ability to examine memory, then you can easily see the untouched 0xde 0xad bytes in memory and so determine how much stack has been used. <S> It's usually hard to detect an overflow as it occurs since function call return addresses are stored on the stack and any function return will send the program off into the weeds. <S> In this case, if your watchdog is enabled and you can set a breakpoint at the reset vector, you may still be able to examine the memory and look for your prefill bytes to determine if this is what has caused a reset. <A> Create a variable that is located at the top (or bottom) of your stack. <S> Initialize the variable at the beginning of main. <S> Or if your debugger allows, set a breakpoint when that variable is written. <S> It should be written only when it is initialized. <A> You can get some information using Splint , as it check for problems using your source code. <S> I think it does not check for stack problems, but can give you some insights on the problem.
You can check the value of the variable in the main loop to see after-the-fact that the stack has overflowed. There are some programs that can do statically analysis.
What is the XMOS series? Ok, so I recently have been seeing the name XMOS appear in places. I've looked on their website and searched online but I can't quite figure out what it is? So what is it? It appears to be a cross between a microcontroller and an FPGA? I've also looked on their site and I wasn't able to see anything I could understand (just example designs and other reference documents) for what XMOS is and what is different about it from other microcontroller lines. <Q> I've got a lot of XMOS hardware. <S> The chips can replace FPGAs and DSPs in a lot of applications, with development being much quicker and cheaper. <S> They are mainly programmed in XC (a superset of C intended for parallel processing), C, C++ and assembler. <S> The languages can be mixed in the same application. <S> Other programming languages are becoming available. <S> Each thread can run at 50 or 100 MIPS, and can be thought of as a separate processor. <S> The four-core device thus offers up to 32 threads, delivering a total of 1600 MIPS. <S> Threads, cores and chips communicate via very fast communication channels, making it very easy to design parallel processing systems using arbitrary numbers of chips. <S> Peripherals like UARTs, SPI etc. are implemented in software. <S> They are fast enough to handle high-speed (480 MBit/s) USB and 100 MHz Ethernet in software. <S> Single-core, dual-core, and four-core devices are available with 64 <S> I/Os per core. <S> On-chip RAM is 64k per core. <S> Killer applications include those massive LED displays used at sporting arenas, where FPGAs have been used up to now. <S> They typically use hundreds of XMOS chips, one per display tile. <S> They are also ideal for high-end robotic applications. <S> Board prices start at about 50 dollars for a prototyping board with a single core device. <S> The JTAG interface needed for programming and debugging applications is another 50 dollars. <S> Development software is free. <S> Support is good, via the XMOS web site and a users forum. <S> They are getting popular with hobbyists. <S> A new $7 XS1-L01A-TQ48 device is now in production. <S> They are listed on Digi-Key. <A> David May of XMOS presented an introduction to XMOS at the first OSHUG (Open Source Hardware) event last year: http://www.vimeo.com/11624968 <A> XMOS is a powerful, multicore, 32bit microcontroller. <S> There is no FPGA involved, but they go great together. <A> <A> I'm also interested in this processor and am poking around their site. <S> I wouldn't mind spending $100 for the bare minimum to get started, as Leon had mentioned. <S> However, I wasn't sure what to buy -- their development board page talks about different chips, but I couldn't figure out the differences between them. <S> Here's a helpful link <S> that outlines the types of XMOS processors. <S> I wasn't able to find it by clicking around their website. <S> In a nutshell, it looks like they have 4 different processors: XS1-G4: 4 coresXS1-G2: <S> 2 coresXS1-L1: <S> 1 coreXS1-L2: <S> 2 cores <S> The strange thing is that, for beginners, I would expect the XS1-L1 to be the best choice, as you can still learn how to leverage multithreading, but possibly save a little money on the development board. <S> However, this doesn't seem to be the case. <S> Both the XK-1A and XC-1A are $99, and include JTAG hardware. <S> Maybe Leon can add a comment here and let us know what he thinks is the best starter kit for those interested in getting into XMOS.
They are basically very fast multicore controllers, with up to eight hardware threads per 400 MIPS core, operating in round-robin fashion. XMOS is an event-driven processor, perhaps check some out their videos http://www.xmos.com/videos
Recommendation for a USB digital simulator It's becoming quite frequent to me having a new digital subsystem which I want to test in isolation before trying to make a prototype circuit. I've been using the digital analyzer by Saleae for inputs, which is quite handy, but I'm wondering if I could find or build its counterpart. Ideally it would be a device to plug in an USB port, would have many digital outputs (let's say 20 or more) and would come with software that would enable me to do a playback from a prerecorded file, or generate the output with a program or script. Does anyone know about such a product, or have guidelines to build on my own? <Q> The product you're looking for is a digital pattern generator. <S> While this one is overkill for your specification, it's the one that I'm most familiar with. <S> It'll probably set you back about $12-20k for a full setup. <S> Basically their setup is a FPGA hooked up to a bunch of RAM driving 16 logic outputs. <S> It's really fancy because you can set the frequency and output voltage of the module. <S> Cheaper, slower, and less-flexible modules should be available from someone else. <A> This sounds like a crude definition of a microcontroller. <S> It has GPIOs and can fetch instructions from memory. <S> Hardware requirements are based on the following: <S> memory: <S> How much playback do you need? <S> The Salae uses 10bit samples at up to 24MHz, or 30MB/s (also the single channel USB 2.0 limit). <S> You may require external memory modules to support long traces. <S> This can be done directly from USB, with minimal on-board memory, and would depend on your computer's USB bandwidth, like the Salae does. <S> If you're using both at once your computer's USB controller may reach its limit. <S> I wouldn't want to depend on this. <S> IO speed: Producing multiple 10-bit 24MHz patterns is no small feat. <S> You may need to use multiple slave PWM chips. <S> How much greater the clock speed must be than the PWM frequency depends on the chip family. <S> noise: <S> On a 5V digital system, an 8-bit LSB is about 20mV and a 10-bit LSB is about 5mV. <S> For these bits to be effective your noise level must be below that. <S> This will be important when running so many parallel conductors, all with 24MHz digital* signals. <S> Although this speed is not high, it can have >20mV crosstalk if traces are coupled. <S> I don't think special drivers (bipolar, etc.) or EMI protection is required - just space them out. <S> USB <S> : Look for hardware USB support, or go with an external FDTI chip. <S> It can be done in software as well, and is an option at least for M3s and XMOS, but keep in mind it reduces thread slices for your PWM memory fetching, etc., especially if it is being used to fetch PWM data from USB (limited on-board memory). <S> Possibilities include the PIC24 family, XMOS , and many of the ARM family. <S> There are some great parametric tables out there: RS , Microchip . <S> It would be worth getting to know the differences between ARM implementations to see if one will do everything. <S> Note that you may also want to drop to 8-bit PWM, as you could then lower your hardware <S> requirements.*Yes, they are analog, but they're also a recording of a digital signal. <S> Hopefully they appear so. <A> You could program an Arduino with a pretty basic sketch to give you this capability... and you could write a fancy little C# application to do the pattern definition... <S> that would be the easiest imo. <S> That should cost you not more than $30 and a couple hours of free time :). <S> Maybe someone's already done it...
Look for chips with many hardware PWM modules.
How to use multiple terminal surface mount chips in amateur project? As you can probably tell from the question I am a beginner in the embedded world. The extent of my experience is some playing around with C and assembly using the Arduino. I'd like to make the jump to the more complex embedded chips that use surface mount device package types rather than through hole device package types. How does one integrate them into an amateur project? Are there breakout boards or CPU sockets for them? I was particularly thinking about Motorola ColdFire devices or ARM Cortex M3 devices. Apologies for the question but I'm somewhat lost by the vast array of devices on offer and just need a starting point really. <Q> For SMD there are adapter boards SMD-to-PTH, like Soldering the parts takes some exercise. <S> You may want parts with a 0.8mm pitch instead of the higher density 0.5mm pitch. <S> The latter you'll find mostly on devices with 48 pins or more. <S> The other option is that you design your own boards for which you need an EDA (Elecronic Design Automation) package like Eagle . <S> This has a free version with limitations, or a full version which has to be payed for. <S> This design has a long learning curve. <S> When you designed stuff this way you have to option of etching your own board or have it produced by a PCB production shop. <S> The latter is the best choice for quality, the DIY is cheaper and faster. <A> Most manufacturers offer development kits for their various families. <S> They often also have a blank, 0.1" pitch plate via area for DIP as well as a few common SMD pads for prototyping. <S> The ET-STM32 Stamp is one example; a great kit is the LPCXpresso - make sure you get the right one, as there are two: one -M0 and one -M3(LPC1343). <A> There are 3 approaches to converting a difficult-to-work-with package into something easier to use: generic SMD-to-PTH adapters, as stevenvh mentioned. <S> For example, it seems that lots of microcontrollers come in a 44-pin TQFP package; you can solder any one of them to a generic 44-pin TQFP-to-PTH adapter. <S> A few of them are "breadboard compatible". <S> Alas, this usually requires you to find someone capable of doing this soldering. <S> "breadboard compatible" plug-in modules that come with a CPU already soldered to it, pins that plug directly into a breadboard, and perhaps also including a crystal and a program-download header and a few other parts. <S> See https://electronics.stackexchange.com/questions/5658/searching-for-atmel-arm-mcu-in-a-breadboard-setup-like-arduino-nano-but-obvio . <S> " demo boards " with a CPU already soldered to it and a few other parts, often including some kind of connector for connecting your other parts to it. <S> There are many ARM demo boards . <S> There seem to be quite a few projects standardizing on the "Arduino" form factor and upgrading to a more powerful processor. <S> I see the ARMmite PRO, Cortino, FEZ Domino, Maple boards, and netduino all use some kind of ARM processor in a Arduino form factor . <S> Yes, the vast array of devices is pretty overwhelming. <S> Things have sure changed from the day where, if you wanted a CPU for less than $100, you had one and only one "choice".
For starters I recommend the adapter boards I mentioned at the beginning of this answer. Sparkfun sells a bunch of breakout boards with other complex non-CPU surface-mount chips soldered to them.
Can I put multiple resistors in series to get higher resistance? If I put 3 1MΩ resistors in series, is that the equivalent of one 3MΩ resistor? <Q> The short answer: <S> Yes. <S> It's the same. <S> The current through resistors in series stays the same, but the voltage across each resistor can be different. <S> The sum of the potential differences (voltage) is equal to the total voltage. <S> To find their total resistance: <S> By Wikipedia <S> But this the ideal value. <S> In the real word, resistors have tolerances and you have take in count. <S> E.g., tolerance of 10%. <S> The final value can vary between 2.7MΩ to 3.3MΩ. <A> There are two main reasons why you would do this. <S> to obtain a value you don't have in you box. <S> For instance a 30k resistor is not an E12 series value, but you can obtain it by putting two 15k resistors in series to allow a higher voltage. <S> 0603 resistors have a working voltage of 50V, So if you want to use them in a 70V circuit you'll have to place at least two of them in series. <S> Care should be taken if you pick unequal values. <S> Divide the voltage by the total resistance to get the current flowing through the resistors, and multiply this current by each of the resistances in turn to get the voltage over this resistor. <S> In the 0603 example none of the voltages should exceed 50V. <A> Yes of course, and to add some marginally more interesting content to my answer, you can also put resistors in parallel to get a lower resistance, though the effective resistance is not quite as straightforward as the simple sum for series resistance. <S> Parallel resistance is calculated as (R1 * R2) / (R1 + R2), which equals R/2 for R <S> = R1 = R2... <S> More formally, for n resistors in series: R_effective = <S> SUM(i=1, <S> i=n <S> , R_i) ... <S> and for n resistors in parallel: R_effective = 1 <S> / SUM(i=1, <S> i=n, <S> 1/R_i) <A> If I put 3 1MΩ resistors in series, is that the equivalent of one 3MΩ resistor? <S> I don't know exactly whether your question contains a trap. <S> If you put at most 2 resistors in super cold environment and the remaining one(s) in hotter place, the combined resistance will probably no longer equal to 3 mega ohms.
If you place resistors in series the total resistance is the sum of the resistances of all resistors in the chain.
Voltage transition sense - rapid raise or fall Which means do we have to sense (relatively) fast voltage transition from one value to another . The exact point of transition start , transition end and the intermediate state . Which schematic gives us indication of these points. And the special case: how do ICs sense voltage raise or fall? Edit : Last edit turned question to the wrong direction, so I rolled it back and rephrased. <Q> See Schmitt Trigger - http://en.wikipedia.org/wiki/Schmidt_trigger <S> basically it's an amplifier circuit with positive feedback. <A> This really depends how far down <S> you want to go. <S> Keep in mind that every MCU that you will use is composed entirely of simple elements. <S> Specifically, you will find transistors, capacitors, resistors, and diodes in every microcontroller and microprocessor since they stopped using vacuum tubes. <S> The logical comparison is typically an exclusive-or. <S> Then measure the voltage difference between the capacitor and the input - if the difference is close to zero, then there has not been a change. <S> If the difference is large, then the input has just changed. <A> I don't understand the insistence on using "MCUs" instead of "ICs". <S> MCUs are ICs , and many ICs also have digital inputs. <S> Furthermore, a MCU is basically just a specialty IC, and you can actually make a MCU out of a bunch of ICs. <S> The behavior of the inputs and outputs of a Schmitt trigger are thus: <S> Both axes are in voltage. <S> ( Shamelessly pillaged from wikipedia ) As you can see, the Schmitt-Trigger is specifically designed to not have an "intermediate state". <S> The "transition start, transition end and the intermediate state" are all part dependent, and there is no blanket answer. <S> Read the datasheets for your part for the answer. <S> Here is a simulation of how edge triggering works at the logic-level: http://www.play-hookey.com/digital/rs_nand_flip-flop.html <S> vicatcu has already covered the analog underpinning to building a schmitt trigger. <S> Interestingly enough, for logic devices without buffered/schmitt-trigger inputs, if you wrap negative feedback around the device, you can actually use it in an "analog mode", kind of like an amplifier. <S> It's not a good idea, though, and it may damage some parts. <S> Also, there may be wide variations between parts from the same manufacturer, since analog performance is not specified or controlled.
You could make a very simple edge-detection circuit by using a resistor and capacitor in series to store the input voltage. Without getting into digital logic fundamentals, a MCU can tell if an input changes by storing the digital value of a pin (1 or 0), and then comparing that stored value to the current pin value.
Are power supplies for USB drive enclosures required to have UL certification? I bought a cheap USB hard drive enclosure off eBay. It turns out that the power supply has absolutely no electrical certifications for either the US or EU (no UL, CE marks). Is electrical certification required for these power adapters (that come with USB drive enclosures)? Is it safe to use a power supply that doesn't have the electrical certification? <Q> Does the power supply plug into the mains? <S> (although I believe it is a requirement to have some sort of certification, UL or otherwise) It does make the product look dodgy. <S> It is certainly illegal to not have FCC/CE certification especially as switch mode adapters like those emit hideous amounts of EMI unless properly designed. <A> Any power supply product sold in North America needs to be certified to certain standards to be safely used without special intervention: UL 60950 for non-medical stuff in the USA, CSA C22.2 for Canada - the standards are largely similar and certification usually happens for both markets simultaneously. <S> There should be some agency marks - a UL mark or an NRTL-equivalent. <S> Safety agencies can be called on to do a field evaluation of a single piece of equipment, against a lower standard than a usual certification. <S> You're on the hook to pay for it yourself, so judge accordingly - <S> it's likely much cheaper to get an approved power supply than pay for an evaluation. <S> Don't expect any payout from your insurance if your house burns down. <A> Inherently unsafe? <S> Not necessarily. <S> It could be a conforming product that was not labeled because the OEM relied on the reseller to test and label the product for specific markets. <S> That said, it's also possible that the product is made with unsafe components, or will fail some hazard condition that a certified product would have been tested for. <S> In some jurisdictions, you cannot use a non-UL (or equivalent like CSA) product. <S> If an inspector finds a non-certified equipment, he could order you immediately discontinue its use. <S> Lack of labeling on the immediate product does not necessarily mean that the product is not certified -- in rare instances (a product that is "too small" to carry the mark, for example), the there is a separate, valid documentation of its certificated status. <S> The collection of relevant standards make up a large binder... <S> You have to buy ( here , here , here , ...) <S> the standards books (or, rather, gain access to the electronic versions of the same) - and it is definitely not cheap. <S> If you are developing a product, talking to a test lab and "pre evaluating" the product will usually yield some of the relevant details; and when you fail a test, they'll usually give you a copy of the rule that you failed for...
If you're using a product without marks or a field evaluation, you're using it at your own risk. I'm not sure if it's illegal to go without UL certification as UL aren't a federal requirement
How to release ice cubes out of a box? For a University project I have to build a small box containing ice cubes. The box is a shoe box, isolated with newspaper and aluminium foil, cooled by thermal packs. In this box I want to store ice cubes for about one to three hours. Now comes the tricky part: The ice cubes should drop out of the box, one after another, about every minute. I was thinking of a motor with an oval disk which opens a flap gate. The second idea was a small conveyor band which transports the cubes out. Are there better solutions than that? What minimum motor power do I need for this? How do I control the motor? It's a low-budget project, so the cheapest solution is the best. <Q> These are hard questions to answer, not because the information you need is hard to come by, but because answering them in a straightforward way will keep you from learning how to do it yourself, which is presumably why you're going to college in the first place. <S> On the other hand, it reasonable to say, "Look, I don't know how to do this, and there is no point in trying to reinvent motor control from first principles." <S> So how about this for an answer that will get you started. <S> You're trying to do a task where the motor will need to spin a little bit, then stop and wait, then repeat. <S> Also, overall, this is a pretty low power task-- <S> you're not trying to move a car or train. <S> For this kind of low-power, intermittent duty task, I'd probably start with a small stepper motor , like you find in old disk drives or printers. <S> You could also use a small DC motor , like you find in most motorized toys, but you'll probably need some clever ratcheting mechanism to make the intermittent motion you're after. <S> In general, motor power is proportional to volume; you want a motor that is bigger than a grape and smaller than an apple. <S> The next step is to google "stepper motor" and "dc motor controller. <S> " I'm afraid Wikipedia will be incomprehensible at this stage; I'd look for tutorials from robotics clubs or intro electronics sites. <S> You might start with: http://www.doc.ic.ac.uk/~ih/doc/stepper/ http://www.seattlerobotics.org/encoder/200001/simplemotor.htm <S> After that, since you say this is a low-budget project, I'd try to find something with a motor in it that you can reuse-- maybe the mechanism from an inkjet printer (stepper motor) or an RC car (DC motor). <S> You might be able to reuse something without taking it apart-- like maybe you could just have the printer print a page once a minute, and the motion would pull on a string that somehow moved the ice. <S> From there, draw a lot of pictures of what you want to build and try building some crappy prototypes out of cardboard, string, and paper. <S> You'll learn faster by testing and failing than by trying to plan it all out in your head first. <S> Good luck. <A> I'm not sure how easy it is to come by, but I'd look for an old refrigerator with ice dispenser. <S> All dispensing mechanisms I've seen are screws/augers that grab some ice and push it forwards to drop it down a hole into your drink. <S> You may be able to modify the "intake" to grab one cube at a time, or if it's not that critical <S> you get 1 cube/min, just use it stock. <A> I believe that the ice maker in a refrigerator uses an auger-type delivery system. <S> You could make something like that with copper tubing or something else <S> that's malleable enough to bend into that shape.
I'd use a stepper motor as suggested above and have a photosensor determine when a single ice cube has dropped and then open a door (if it absolutely has to be one-at-time).
Develop an OpAmp circuit to measure average voltages With four different sensors, V1, V2 V3, and V4 I need to develope an operational amplifier circuit to measure average temperature with following specifications: The output voltage range of each sensor is limited to 0-5 V The output voltage range of average temperature measurement circuit is 0-5V The span adjustment range is +/- 1V Total system accuracywith +/- 0.1% of FSO Please help me to design the above circuit. <Q> For an average voltage you need a voltage adder Since the opamp will set the output such that \$X\$ is at \$0V\$: \$ <S> I_N = \dfrac{V_N}{R_{IN}} <S> \$ <S> Since ideally no current flows into the opamp's input <S> \$ I_F = <S> \Sigma <S> I_N\$ <S> and \$V_{OUT} = <S> -R_F <S> \cdot I_F = <S> -R_F <S> \cdot \Sigma \left(\dfrac{V_N}{R_{IN}}\right) <S> \$ <S> Therefore: \$V_{OUT}=-\dfrac{R_{F}}{R_{IN}}\times (V_1 + V_2 + V_3)\$ <S> To average N inputs \$R_F\$ should be 1/N-th of \$R_{in}\$. <S> You'll want to include negative voltages in the control range. <S> Range adjustment can be done by modifying \$R_F\$ (for all inputs simultaneously) or \$R_{in}\$ (for each input individually). <S> (image taken from http://www.electronics-tutorials.ws/opamp/opamp_4.html ) <A> There are many ways of averaging voltage. <S> Any circuit is an "op amp circuit", once it has an op amp. <S> First, voltages average naturally, like temperature. <S> This can be shown using a passive method, with resistors: A high impedance voltage follower (op amp circuit) is required to maintain accuracy. <S> Another passive method is with capacitors, using charge redistribution. <S> This is related to how many modern analog-to-digital converters (ADCs) are being designed today. <S> It works by storing a voltage on a capacitor, disconnecting from the source signal, then connecting to and redistributing charge with another parallel capacitor, which halves the initial voltage. <S> This can be extended to average four voltages by having them share and redistribute total charge: Again, a high impedance voltage follower is required to maintain accuracy. <S> Either of these concepts can be improved upon in many different ways, using op amps or otherwise. <S> Since this appears to be a homework assignment, I'll leave this bit to you! <A> Try the Handbook of Operational Amplifier Applications pg 65. <S> edit: http://focus.ti.com.cn/cn/lit/an/sboa092a/sboa092a.pdf <A> What stevenvh has show is the classic opamp summing circuit. <S> One advantage of such a circuit is that each signal is feeding into a virtual ground, so there is no back driving of one signal to another. <S> Another characteristic of this circuit is that it inverts. <S> That may or may not make a difference. <S> If the result is going into a microcontroller, then the polarity is irrelevant as the result can be easily flipped in firmware. <S> However, here is another circuit that should work in this case. <S> The assumption is that the output of the sensors is uneffected when driving a impedance above some value. <S> In this case I put 20 KOhm resistor in series with each sensor to satisfy that requirement. <S> All you really need in that case to get the average is 20 KOhms in series with each sensor output <S> then all tied together. <S> Assuming the sensors have very low output impedance, the resulting impedance will be the parallel combination of all the resistors. <S> Since you have 4 signals being averaged, the impedance will be 5 KOhms. <S> If that's good enough, then no opamp is required. <S> If you need lower impedance, then a simple unity gain buffer will do. <S> I have made an example schematic: http://www.embedinc.com/temp/average.gif
For zero adjustment just add another input to which you can apply a variable voltage by means of a potmeter.
What are some simple and informative beginners projects? I'm currently in an "Information Technology" program, and this program includes some electronics courses. So, I know a little bit about voltage sources, current sources, resistors, capacitors, inductors, operational amplifiers, basic first-order filters, and soon I should know a little bit about diodes and transistors. In class, we hear some theory. In labs, we play with oscilloscopes. And these things are all fine and good, but I'd like to building something. I'm tapping you fine folks for resources, simple and informative beginner's projects that will help me learn these topics more solidly. Start me with educative tutorials on blinking lights and finish with educative tutorials on line-following robots (or something like that). I'll emphasize that the recurring theme is 'educative'. I want to make it clear that I do not come from an electronics background. (I just pretend like I do when I'm at school.) <Q> You've come to the right place to find out! <S> It's a good idea to search for previous questions. <S> One trick is to click a tag, like [beginner] , then organize the returned results by clicking one of the headings: about the beginner tag | faq | top users <S> | hot answers <S> | new answers | synonym <S> Clicking " hot answers " gives a bunch of results, of which these look promising: <S> What are the best hardware hacking magazines? <S> Learning Electrical Engineering <S> What are the ways I can make my circuit communicate with a computer? <S> What are the best beginner project using an arduino <S> In my opinion, digging into one of the Arduino kits is a great way to learn electronics. <S> You have to work on fundamental electrical issues, like which way to plug in an LED and what value resistor to use with it, at the same time as successfully using a complete microcontroller implementation. <S> It is a boost regulator, which is much more complicated and exciting than those linear regulators. <S> Understanding how this project works will leave your classmates in the dust, and is essential knowledge later in your career (as a professional or hobbyist). <A> What do you mean "Play with oscilloscopes"? <S> If you're saying that you're demonstrating your filters and voltage sources with input from a function generator and output to an oscilloscope, you should be aware that this is a lot of what analog electronics are about. <S> Packaging some variation of the circuits you've built with a speaker or antenna and battery isn't a very big jump. <S> If you're more interested in blinking lights and robots, you need to get out of your analog classes and take computer engineering classes in digital design, embedded systems, the C programming language, etc. <S> Analog and digital are two very different domains. <A>
You might be interested in finding a hackerspace near your school and seeing what projects people are working on there. Here's another great project to get you started, with plenty of got'chas and complicated electrical schtuff, Adafruit's Mintyboost .
Arduino: is it worth it? I've played with AVRs before with my atmel development kit and have seen recently the use of Arduinos increasing. I have a few questions from users: Is it the same as using a microcontroller? Are there any restrictions with the use of the Arduino instead of using the microcontroller? I am interested in moving to them but also which should i get as there are so many to choose from. <Q> The various Arduino boards use AVR micro-controllers. <S> However, the Arduino software doesn't support in-circuit debugging, which is available with other development software like Atmel's AVR Studio. <S> You can use the Arduino hardware with AVR Studio and Atmel hardware tools like the Dragon programmer/debugger. <S> The Arduino software supports downloading to the target via a bootloader. <S> The Arduino web site and forums are very useful if you need help. <A> An Arduino is basically a cheap, unsupported ("open-source") development board. <S> You can use the Arduino libraries and software for a gentle introduction to MCUs, or you could go all out and use none of it and develop on the Atmel AVR directly with <S> AVR Studio and WinAVR (containing the avr-gcc compiler). <S> Even if you don't use Arduino software, the board is still going to be physically the same size, so there's nothing preventing you from using shields , which is a convenient way for hobbyists to add hardware if you don't want to do much component assembly (let alone make/drill PCBs). <S> For what it's worth, I somewhat like the Arduino concept, but the use of C++ is obnoxious, and I fail to see the value in hiding main(); from the user. <S> Fortunately, that can all be done away with. <A> Actually avr-gcc is under the covers in Arduino as well... you just have to use C++-ish syntax if you're using their libraries or writing your own. <S> Otherwise, the only constraint is that you are 'forced' to use the pattern equivalent to: int main(int argc, char <S> *argv[]){ setup(); for(;;){ loop(); } return 0;} which is a pattern that fits a large cross-section (arguably the entirety) of embedded design. <S> You just implement setup() and loop(). <S> Also it's not a choice between Arduino and a micro-controller. <S> In principle, you could take the ATMega328P out of an Arduino board context, programmed with a sketch, and transplant it into a more tightly integrated solution. <S> So I guess I disagree with the sentiment of some of the other answers here suggesting that Arduino is just a "toy" platform. <S> In my opinion it's viable for more "serious" development. <S> It just lowers the barrier to entry into the embedded world. <S> The ability to program it without a separate programmer (e.g. AVRISP mkII, STK500, etc.) is kind of a big deal in this regard. <S> I don't really think that it demands significant compromise from more advanced users. <A> My first question for you is -- what are you going to do with it? <S> While getting Arduino up and running is easy and there are quite a few sketches available to play with, development isn't all that fun. <S> IMO, the IDE is a little quirky and some of the keyboard shortcuts are really obnoxious to Visual Studio developers. <S> :) <S> Like Leon said, you won't have in-circuit debugging, but some of the other ease-of-entry devices like mbed don't have it, either. <S> If you're just playing around and bitbanging to learn about LCDs, or want to read sensor data, or interact with serial devices, it's great. <S> However, if I were deciding on a platform for a consumer-ish product, I would choose something else that provided in-circuit debugging. <A> Dave Jones did a video blog on the Arduino. <S> If the link doesn't work search for the EEVBlog #45.
With the appropriate software, using the Arduino is the same as using any other micro-controller.
How do I convert 9 V DC to 5 V? What's a good way to reduce the output from a 9V battery to the 1.8V to 5V required by an ATmega328 controller? The context is a small robotics platform with low power requirements (very slow movement). <Q> I would use a 7805 to get 5 volts simple circuit. <S> Here is a image: idea: please make sure that caps are ceramic/polymer caps. <S> The ceramic caps only have low ESR value. <S> specially the right hand one. <A> Since you want to power from a 9V battery we have to look out for possible current losses. <S> While a three-legger like LM7805 may be an obvious choice, this regulator has a ground current of 8mA maximum. <S> An LDO (low drop-out) regulator typically needs far less, e.g. the ground current of an LP2981 is only 800 \$\mu\$ A maximum. <S> That's only 10%! <S> LDOs are as easy to use as an LM7805. <S> The output capacitor is a bit larger, though, important for stability. <S> edit Johan wanted an example: <S> If not used, the ON/OFF input must be tied to \$V_{IN}\$ . <S> The output capacitor value of 3.3 \$\mu\$ F is the minimum required for stability. <S> " <S> More capacitance provides superior dynamic performance and additional stability margin" ( dixit NS ) <S> edit 2 <S> You can even save more power, but it's probably not worthwhile; your motors may consume a lot more than the LDO's 800 \$\mu\$ <S> A. Anyway, there are LDOs with < 1 \$\mu\$ <S> A ground current, like the Seiko S-812C50 . <S> Input voltage up to 16V, output voltage is selectable from 2V to 6V in 100mV increments. <S> Output current is limited, however, to 50-75mA. <A> I might consider just providing the ATmega328 unregulated power unless you have something that actually requires it on the board. <S> 2-3 AA cells should remain within 1.8 to 5.5 V over their life. <S> A schottky might be prudent <S> if you insert the batteries the wrong way (probably will need 3 cells then), and you could add a TVS if you want to be even safer. <A> It depends how efficient you need it to be. <S> Simplest would be an LM317, but it will waste a lot of power. <S> I wouldn't use a 9V battery, though. <A> if you want an efficient solution, using a Buck Converter would be a smart choice. <S> you can build it with discrete components (inductor, diode, capacitor and transistor) or you can use some IC. <S> http://en.wikipedia.org/wiki/Buck_converter <A> Another way to drop the voltage down from 9V would be to put an appropriate number of forward biased diodes in series with the positive supply. <S> Typically you get about 0.7V drop per diode, so to bring it down to 5V from 9V <S> you'd need something like 6 diodes in series. <S> Fine... or a single Zener diode!
A switcher would be better, like those made by Nat Semi.
Need help debugging my project: Fuses popping like crazy, but I can't find the reason why I recently made a voltage and current controlled supply from a kit I found. It worked for about 15 minutes and then fuses started popping. Unfortunately, I have no idea why, because power supply worked for some time fine then and there were no changes to (just voltmeter connected all the time to output) it when fuse problems started. At first, I thought that some part overheated and malfunctioned, but everything felt cool. Next idea was that a piece of debris inside the box might have caused a short circuit somewhere. I carefully checked the box and didn't find anything which could have caused short circuit. Next thought was that maybe IC died. I already asked about that here , so I decided to separate circuit board and transformer and check transformer to make sure it was working correctly. So on one side I had PCB and on the other 50 VA transformer connected to a Graetz bridge rectifier. Here's the picture of the transformer part of the circuit. I connected ends of the rectifier to my multimeter and powered on the transformer and got around 25 V, as expected. A minute or two later, fuse died again. To me this looked very strange, because the rectifier wasn't actually connected to anything. Since I run out of required fuses, I decided to connect my multimeter in place of the fuse and see what's going on with current. At first, I connected it to 20 A range and saw that at the time I press the power switch, I get around 0.02 A. In less then a second, that falls to zero. I switched to milliamp scale and got same 20 mA. After power-cycling transformer again, the 200 mA fast multimeter fuse for milliamp scale died. By this time I was left only with a 10 A fuse, so I decided to do some testing with it. Since the original recommended fuses were of 315 mA fast type, I decided to be extra careful. I checked insides of the box again, checked both switches, all wires and as far as I can see, everything is working correctly. I turned the transformer on with 10 A fuse and did some voltage measurements. I get around 27 V when the ends are serially connected and around 13.5 V when I'm using only one end of the transformer. When measuring DC voltage at the rectifier, I get around 25 V for both secondary coils and around 13 V for one secondary coil. I also get around 9 V AC at the rectifier for both secondary coils and around 3.5 V AC for single secondary coil. I also noticed that when power switch is in OFF position, I get around 3 V AC at the rectifier input and around 3 V DC at the rectified output. These only disappear when I pull the power plug. After all this, I concluded that there must be something in the transformer/rectifier part of the circuit that is making fuses blow. Any ideas how to find out exactly what it is? Also, is the behavior of the rectifier normal and should I change the switch to double pole switch which would control both power lines? EDIT 1 I connected the PCB to the rectifier and turned it on with 10 A fuse. I'm running a small 9 V DC radio from the power source and it seems to be working correctly. Could it be that the recommended fuse current is wrong? The transformer's maximum output current is 2.1 A, so if I'm calculating correctly, maximum input current should be 230 mA. I used 315 mA fuses, so the should have survived full load on the transformer. IS there something I'm missing here? EDIT 2 Looks like the fuses could be blowing because of inrush current of the transformer. How would I solve that problem? One of the fuses I used and which blew was a slow acting fuse, so they aren't the solution. <Q> They are there specifically to stop inrush current. <S> I would check to see if one of the diode's is fried. <S> If you had one fried it will open-circuit for one half of the phase. <S> When it open-circuits the coil will just become a floating load. <S> This will cause a much higher current. <S> Test it by replacing the diodes. <S> try measuring them to see if one has a higher resistance than the others. <S> Someone correct me if I am wrong. <S> Addendum: more about choke coils. <S> Here are some: <S> http://industrial.panasonic.com/www-ctlg/ctlg/qAGL0000_WW.html <S> I googled choke coil to find the best explanation, I read the first paragraph of this and it sounded like it would be of help, so <S> here you go: http://www.wisegeek.com/what-is-a-choke-coil.htm <A> A 50VA transformer will take about 0.21 Amps when correctly loaded (VA / Input voltage) <S> So a fuse of about 1.5 x the input is suggested and should be Anti Surge (Usually marked T or TT - T <S> stands for "träge" which is german for Lazy or slow) - so 315mA A/S or 400mA A <S> /S <S> If your fuses are vaporized and cover insides with remains of the wire - <S> This indicates a major short... <S> What type of transformer are you using - is it a toroidal - <S> if so have you got a shorted turn (if you mount a toroidal transformer incorrectly you can add an extra winding which is shorted out - <S> this is creates by mounting the transformer with a conductive clamp which is bolted down in the middle - if you are using a toroidal - try removing the clamp...) <S> It is possible that you have a faulty diode in your bridge - I have seen diodes that measure OK when tested with a meter, but when either loaded, or subjected to a higher voltage, break down and become shorts, or leak - the easiest way to prove is to replace ALL the diodes, as I have found if one is faulty, it usually subjects others in the bridge to stress, which may make them more likely fail, and for the cost of 4 diodes of 1N400X or 1N540X - I usually use 1N4007 or 1N5408... <A> As transformers take a surge when turned on, I would suggest an Anti-Surge Fuse on the input. <S> Also does the fuse blow when you operate the switch to change ranges <S> How does the fuse look <S> after it has blown, on clear fuses you can see the wire inside, if the wire has a 'small' gap this means it is a 'minor' overload, <S> if the wire has a large gap, or has vaporised and covers the inside with a dark stain, this indicates a 'major' overload. <S> A minor overload is either an long overload just above the rating of the fuse, e.g. 2 x fuse rating. <S> A Major overload is e.g. 10-20 (or more) <S> x rating of fuse. <A> Use a higher rated fuse. <S> The transformer will require magnetising current to set up its field in addition to the current the load will take. <S> Dont forget that the fuse is there only to protect against a 'catastrophic failure' of the downstream kit, not to give you a precision current limit
- some rotary switches are make before break - this means that when switching the output is connected to both inputs, this will short out one winding on the transformer and this will blow the fuse. If you think it is happening due to inrush current, then it could probably be solved by a choke coil .
How do components fail? How do components fail? General rules with an answer per component type would be valuable. We can work as a community to build up a single question that holds valuable information about how components fail. <Q> Switches and pushbuttons: failure to make contact. <S> What you've listed looks like the severity part of an FMEA (Failure Mode and Effect Analysis), at least at component level. <S> While it's not impossible, <S> it's a hell of a job to account for every possible component failure if your design has, say, over a hundred components. <S> One failing component may cause an avalanche of other components failing. <S> Most failures aren't subtle. <S> You'll experience that adding components to cope with other components failing only adds complexity; you'll have to do an FMEA for these components as well! <S> An alternative approach, FMEA-wise, may be to start from occurrences. <S> What's the MTTF <S> (Mean Time To Failure)? <S> Most components are quite robust; tens of thousands of POH (power-on hours) are feasable. <S> (A notable weaker component is the Al elco, but even there are solutions). <S> Anyway, an IC usually doesn't short just like that. <S> So, while component failure may be caused by aging, most failures are caused by external factors , like overvoltage on the grid, or user error like misconnecting. <S> Try to reduce these risks. <S> Power spikes may be handled by overvoltage protection diodes. <S> Misconnection can be avoided by using different connectors so that they can't be switched. <S> Color code wires and use matching colors on connectors. <S> Bottom line: it may be more important to know why components fail than how they do. <A> PCBs: <S> cracks in vias <S> The story: my brother had one of Philips' first CD players. <S> One time it stopped working, but when I looked into it it worked again. <S> This happened a few times. <S> Trying to find out about the circumstances when it happened my brother said that the last time there was a thunderstorm. <S> A lightning strike may do bad things to electronics, though in those cases the device doesn't start working again all by itself. <S> One day I was discussing the problem with a colleague when the conversation was overheard by a product manager (I was working for Philips Audio at the time). <S> PM said that only after much searching they had found the cause of this problem: the PCB was made from some cheap material (I don't recall which, it may have been FR-2) which tended to expand when there was much moisture in the air, like during a thunderstorm. <S> As a consequence the few vias on the board would crack open. <S> When the air became drier again the PCB's thickness returned to normal, restoring the vias. <S> That was one reason why I couldn't find anything. <S> Another was that touching the PCB with a multimeter's probe caused enough pressure to close the cracks (these are microcracks!). <S> The remedy: soldering a wire in each via. <S> Design solution: use FR-4 for PCBs. <S> Like I already said in my other answer <S> it's important to know why the vias crack; it's no good just knowing how they do. <A> Resistors: <S> Almost always open circuit <S> Capacitors (Electrolytic): <S> Reduction in capacitance, leakage of electrolyte, eventually leading to open circuit Capacitors (Ceramic): <S> Reduction in capacitance - eventually failing open, though severe over-voltage can lead to failing closed (Citation needed). <S> LEDs: <S> Gradual dimming then failing open Zeners: <S> Fails shorted in 90% of cases but can fail open due to extreme overheating <S> (device can split into two pieces). <S> Sometimes Zener become little resistive in the reverse region. <S> When this happens some current flow before the zener voltage. <A> electr. <S> CAP - short is possible due to deformation = <S> > explodes. <S> ICs: internal wires fail open, internal safety diodes shorts, gate latchups(might be not fatal), degraded performance due to semiconductor degradation <S> (when working at >100C), soft errors due to radiation. <S> Power ICs might explode (I got hit by one) when failing under load. <A> Resistors Failure Modes Resistor failures are considered to be electrical opens, shorts or a radical variation from the resistor specifications. <S> The failure modes experienced vary with the type of construction. <S> A fixed composition resistor normally fails in an open configuration when overheated or overly stressed due to shock or vibration. <S> Excessive humidity may cause an increase in resistance. <S> A variable composition resistor may wear after extensive use, and worn away particles may cause high resistance short circuits. <S> Wirewound resistors may experience open windings due to overheating or stress, or short circuited windings due to accumulation of dirt, dust, breakdown of the insulation coating or high humidity. <S> Film resistors fail for the same reasons as wirewound and composition, but have also failed due to changes in resistive material characteristics resulting in reduction and increase in resistance value. <S> Electronic Components - Resistors. <S> (1978). <S> FDA Inspection Technical Guides. <S> Retrieved from http://www.fda.gov/iceci/inspections/inspectionguides/inspectiontechnicalguides/ucm072904.htm <A> Ceramics can also fail short circuit, which can be exciting if they are decoupling a high-current supply... <S> Kemet's capacitor failures page <S> Syfer's appnote on capacitor cracking AVX's appnote on cracking <A> Electronic system reliability is an ugly problem, but you can get a idea of how it's done in the aerospace business by reading MIL-HDBK-217. <S> Mil standards can be found at The DOD Website ASSIST . <S> The Wikipedia entry: Reliability Engineering has a good overview. <A> TVS : <S> Fails shorted in 90% of cases but can fail open due to extreme overheating (device can split into two pieces)
MOSFETs: Short circuit usually (with a bang), eventually leading to open failure due to melting of device
Microcontroller support for Teletype I want to receive 5-bit serial words using a microcontroller's hardware UART at 45 Baud. This is the basic protocol for teletype machines. Since the baud rate is 45, I really want this done in hardware so that I am not spending all the processor time polling a pin, and for ease of programming. Are there microcontrollers that can do 5-bit serial data in hardware? Is there a reasonable hardware/software implementation that won't tie up the processor? <Q> If you have sufficient intercharacter space (~3 extra stop bits), you could use the MCU UART port, as there isn't really a difference between an 8-bit character (0x00 through 0x1F) on a UART and a 5-bit character with 4 stop bits. <S> Barring that, your best bet would be to use a level interrupt (pin change, etc) to detect the leading edge of the start bit, then configure a timer to interrupt you either once per bit or possibly a couple times so you can do some extra verification. <S> 45 baud is really slow, so unless you're using upwards of 95% of the MCU time (or all it's peripherals), this shouldn't cause any problems. <S> The Atmel AVR USART module supports 5-9 bit modes, so any (newer) ATtiny (e.g. ATtiny2313) or ATmega (e.g. ATmega328P) will allow you to do this in hardware, vastly simplifying your software, saving your time. <S> The maximum clock divider you can apply to the UART on an AVR is 2 16 , so if you have a clock of 16 MHz, the lowest rate it can run at is 244 bps with no system clock divider. <S> If you use an ATmega, like on an Arduino, the clock prescale register ( CLKPR , §8.12.2 in Atmega48/88/168/328 datasheet) can be used to slow down the system clock up to 256x at run-time, or simply program the CKDIV8 fuse to set the prescale register's default to 8. <S> The real determining factor on what you should use is what else you're doing besides talking with the TTY. <S> If you are going to plug this into a computer, you will want to reserve a (or the, if there's only 1) UART for communicating with the PC and do a software UART if required (as mentioned by everyone, this is near trivial at 45 bps). <S> If you want to press a button and have the TTY do something, using the only UART for that would be fine. <A> The first three datasheets I looked at all show support for 5 bit serial communication. <S> Here is the list: <S> Atmel SAM3S <S> TI Stellaris Freesscale Kinetis <A> You will probably have to bit-bang the interface. <S> Any MCU will be suitable. <A> For normal asynchronous operation on the ATTiny2313 AVR, lets say running at 1.8432MHz <S> set: <S> UBRR = 0x9FF <S> ; //(f_osc / (16 * BAUD)) - 1 = 2559 =UCSRA = 0x00; // 1x trasnmit speed, multi-processor mode disabledUCSRB = 0xD8; // enable rx and tx complete interrupts, enable tx and rx hardwareUCSRC <S> = 0x00; // 5 data-bits, 1 stop-bit <S> , no parity bits <S> Then implement the RX and TX complete interrupts and you should be good to go. <A> SiLabs 80C51F0XX has only 8 and 9 bit.
Looking at the datasheet: LPC17xx has support for 5 Bit data.
Building an electrically controlled spring based catapult A spring based catapult is at rest vertically. It gets pulled back to a horizontal position to arm, which activates a self-ball loader. On firing, it springs forward and launches ball. The arming mechanism will be motor based but the issue I can't get past is the motor on the launch portion. My ideas include: Bike chain and gearing. Some sort of clutch on motor that releases on launch. Some sort of indexed cog off the motor that pushes the catapult to the horizontal but at that point the catapult releases back forward and the cog spins around again to pick up. I've considered stepper motors but I'd like to keep it as simple as possible. Further Details - The spring in question is actually a car engine belt tensioner. So we are talking roughly maybe 30 foot lbs to compress. It is bolted to a 3 ton jack stand which is bolted to a frame. The frame right now is roughly 30 in long, the catapult arm length is still in question due to distance requirements of projectile. I am considering making the arm length adjustable. The ball feed mechanism is basically PVC with spring gate that gets compressed when arm is pulled down. Projectiles are baseballs, softballs. snowballs etc.... I am currently stuck on finding the right motor. So far I've ripped apart a belt sander and an Oreck vacuum looking for answers, with no luck. I am also considering winch methodology or possibly chain hoist theory. Thanks for the responses. <Q> You could probably do the whole thing with one motor and a solenoid using the same principle as a car's start motor / starter solenoid. <S> Basically, mount a gear to the main arm. <S> The solenoid would push the drive gear (which is attached to the motor with a worm gear) against the main arm gear to lower it down. <S> To launch, disengage the solenoid. <S> Note that you can make your own simple solenoid with a simple electromagnet / spring in opposition. <S> I haven't thought a whole lot about the loading mechanism... <S> Some more information on the size of the apparatus would be helpful. <A> The larger gear should have more teeth than the smaller gear. <S> Then remove / grind off a few adjacent teeth on the larger gear. <S> When the motor spins the larger gear, the teeth are engaged with the catapult gear and causes it to move down, compressing the spring. <S> Before the last tooth on the larger gear disengages from the smaller gear, the ball should get loaded. <S> When the last tooth on the larger gear disengages, the catapult arm's gear is able to spin freely -- this allows the spring to uncoil and launch the object. <S> If you get the gears sized properly, the catapult arm will come to rest before the next tooth on the larger gear re-engages the catapult arm's gear. <S> Just keep spinning the motor, and it'll just reload and launch over and over again. <S> Sounds like a great project to print on my 3D printer. <S> I'll look into this. <S> This also made me think of the geared motor used in the extruder -- you should have no problem finding a motor with enough torque to compress your spring (although I don't know what sort of spring rate you're using). <S> EDIT -- I didn't realize that you also might need info about the loading mechanism. <S> Try drawing up something where the catapult arm, when lowered, hits a shelf with a ball on it. <S> This makes the shelf tilt, and the ball falls into the catapult bucket. <S> The act of tilting also prevents the other balls from coming out. <S> When the catapult fires, the shelf tilts back the other way, allowing the next ball to advance. <S> I think it's a pretty simple singulation device. <S> Your best bet is to prototype this with Lego. <S> EDIT #2 -- does it need to operate like a real catapult, i.e. angular motion? <S> I think an even easier way is to use linear motion for the firing mechanism, with the same sort of gearing that I described above. <S> I think this would simplify the ball singulation. <A> A good source for a drive for something like this would be a cheap electric drill/driver. <S> Easy to control and plenty of torque. <A> Don't mind the updated name, had to register. <S> Here are some of the answers so far. <S> The spring in question is actually a car engine belt tensioner. <S> So we are talking roughly maybe 30 foot lbs to compress. <S> It is bolted to a 3 ton jack stand which is bolted to a frame. <S> Frame right now is roughly 30 in long. <S> Catapult arm length is still in question due to distance requirements of projectile. <S> Considering making arm length adjustable. <S> Ball feed mech is basically pvc with spring gate that gets compressed when arm is pulled down. <S> Projectiles are baseballs, softballs. <S> snowballs etc.... <S> Stuck on finding the right motor at this point. <S> So far I've ripped apart a belt sander and an oreck vacuum looking for answers, with no luck. <S> Thanks for the responses. <A> Back to the gear idea.... wouldn't the large torque from the motor spinning the gear cause a large stress on the gear possibly breaking it when the gear teeth come back around to launch the item again?
Also considering winch methodolgy or possibly chain hoist theory. If you can get a motor with enough torque, I bet you can accomplish this the easiest by putting a larger gear on the motor shaft, and a smaller gear on the catapult arm's pivot point.
Will these LEDs work for throwies? I'm going to try to build some throwies soon and am ordering some LEDs and other needed things for the task. It is my understanding that a CR2032 battery is 2.6-3.1 volts. Well, I have these LEDs picked out. 660 nm wavelength 1.85-2.5V Forward Voltage, at 20mA current Would this be ok to use without any resistors? I'm ok if LED life is shortened, but I definitely don't want for the LED to just light up and then be burnt out a second later. <Q> You need a series resistor to limit the LED current. <S> You can find out how to calculate its value here . <S> In this case your problem is that you have little overhead combined with large tolerances in voltages. <S> The voltage difference between Vbat and Vled can vary between 0.1V and 1.25V. <S> A new battery should give you over 3V; I've measured voltages of 3.4V on CR2032s. <S> OTOH, 2.5V for a red LED is rather high, so I would use the 1.85V for my calculation (even that is a bit high!). <S> So, taking 3.1V for the battery and 1.85V for the LED you need a series resistor of (3.1 - 1.85)V / 20 mA = 62 ohm. <S> A E12 value of 56 ohm will do fine. <S> edit <S> You probably have seen the battery directly placed between the legs of the LED, no resistor, but this will drain the battery fast. <A> Here is some interesting info on throwies from evilmadscientist.com <S> [Connecting a 1.7 V LED directly to a CR2032] <S> Wait-- <S> 107 mA?! <S> --‽ <S> (That is to say, we wasted used up another battery just because we didn't believe it either.) <S> But holy cow anyway. <S> "And they said this was safe? <S> " There are a couple of legitimate concerns here. <S> Lithium coin cells aren't designed to source nearly that much power-- and aren't lithium batteries a fire hazard? <S> And why does my LED-- rated for 25 mA continuous current survive this? <S> I've certainly seen enough LEDs destroyed by overcurrent, and this one was over 25 mA for ten minutes solid. <S> But, and perhaps against my better judgement, I do believe that this actually is safe in practice. <S> With all of the throwies and similar things out there -- don't forget the keychain flashlights -- they just don't seem to be exploding or catching on fire. <S> (Breaking, falling apart, running out of photons, <S> yes-- but those modes of failure are usually not as dangerous.) <S> [...] <S> So.... <S> Do you need a resistor? <S> No, not really. <S> As we said, it seems to be reasonably safe without one. <S> Should you use a resistor? <S> Yeah you should, if you want a red, yellow, or orange LED to last more than a day or so. <S> So you can solder a resistor in place, but that somewhat defeats the purpose of easy to assemble throwies. <S> So to make it not a total pain-in-the rear to add resistors, here's a way to do it without soldering: just twist it. <S> Source: <S> http://www.evilmadscientist.com/article.php/throw <A> Take a peek at the pulsed characteristics for the CR2032 . <S> This load may pull down the voltage to 2.3V-2.9V and IR <S> is ~30Ω. Using the "Pulse" data in the 4th graph (bottom right) : <S> (2.4V-1.85V)/(20mA)=27.5Ω. Your milage may vary. <S> Also, looking at the "Spacial Distribution" graph in the LED datasheet , you can see that its viewing angle is only about 20°. <S> If you want it to look brighter despite poor viewing angle (I bet it is often non-ideal when all you're doing is "throwing" them on out-of-reach surfaces), look for an LED with a better viewing angle. <S> While you're at it, you can get high-efficiency ones that only need a few mA for the same lumens. <S> These are often in surface mount packages, so constructing a throwie would be quite different. <S> Examples: SSL-LX203CSRT , LR T68F-U1AA-1-1-Z , LY T68F-T2V2-35-1-Z . <A> <A> This is the question I was puzzled myself. <S> In theory, even without resistor it might work as battery and LED have internal resistance, but for lithium batteries it's rather low so most likely LED will operate out of specs (but will probably work if you take a powerful one). <S> You'd better use series resistor, you may solder SMD one right on LED legs, so it will not increase dimensions. <S> Values to try 10-100 Ohms.
According to the Energizer CR2032 datasheet I'd say the internal resistance of the battery (10 to 40 Ohm) is too low, so you need a series resistor. Yes, this is reproducible.
What's the uA741's appeal? OK, so the uA741 is 42 years old now. For its time it may have been a great opamp; the requirements weren't as high as today, and there was far less competition. But I was wondering what's the 741's appeal today. it's slow. GBW 1MHz, slew rate < 0.5 V/us it's not low power, nor low voltage it doesn't have low bias current FET inputs it doesn't have rail-to-rail inputs or outputs it's not low noise many more modern opamps have comparable price Why is the 741 still used today? <Q> It's an ideal op amp to learn the basics on due to its non-ideal nature. <S> The first thing we learn is infinite input impedance, infinite gain, as well as a few other silly things. <S> The 741 obeys none of these idealities, forcing students to learn the hard way how to cope. <S> They see bandwidth limitations without using expensive oscillators or function generators; they see early saturation, nowhere near the rails, allowing the use of cheap multimeters. <S> Many textbooks use the 741 as an example due to its ubiquitous availability and simple verification of non-idealities. <S> Today, we can buy op-amps with mV offset and noise, 100s MHz bandwidth, nA leakage, etc.. <S> One of the most time consuming part of a design is looking for parts, especially for the inexperienced. <S> Academics aren't experienced design engineers, and will use the parts they know, as they have better things to do than look for parts (like write that grant application, right? <S> :). <S> This outdated part therefor gets introduced into new designs from copying legacy modular designs, and familiarity from instruction. <A> Many old designs are still around. <S> Plus, some positives are 1) <S> It is readily available from multiple sources (ST, TI, National) which (having multiple sources) can be a big issue for certain industries. <S> 2) It has been around for a while, is well understand, reliable, and will most likely will continual to be available for a while, again, very important for long life applications. <S> 3) <S> It has a large voltage range, many newer op-amps don't. <S> 4) Output short circuit protection. <S> 5) <S> It's slow. <S> Why is faster always better? <S> Having an overly fast op-amp just increases susceptibility to noise. <S> 6) <S> Many people know it and use it, there's something to be said about not having to evaluate, test, etc., a new chip, as well as not having to stock a new part. <S> 7) <S> It doesn't have FET inputs. <S> There are pros and cons to such inputs. <S> Certain designs may be better with them. <A> Is it really used per se, or simply kept around for legacy designs? <S> I can speak to the fact that in both of my career stops <S> thus far, there haven't been any new designs that I've seen or touched using the 741. <S> For me, the LM358/LM324 is the 'go-to' part where things like input offset voltage or rail-to-rail capabilities aren't critical. <S> It's well understood, it 'works', and it's cheap. <A> In many cases I've seen in online electronics forums, the 741 is designed in by beginners who just don't know of any other opamps. <S> They may have read about it in a textbook or seen it in another old design and assumed it was a reasonable choice. <S> Once they learn that LM324, etc. is readily available, cheap and easier to use, they'll normally switch. <S> The other big reason already stated is legacy designs. <S> If you've been selling a product for 30 years and you won't run out of parts, and you won't make any more money by changing to a newer opamp, <S> they why change? <A> My guess: people tend to stick with what they know. <S> If you've learned the errata and gotchas of the 741 and it works for your application you'll use it rather than learn something new for no reason.
Also, my guess is that many applications don't require terribly high performance, so the 741 works just fine. This is good for many applications. Changing an op-amp in an application where those specific parameters are important (i.e. feedback loops) can be problematic at best (or outright dangerous at worst) - best to let sleeping dogs lie in these situations, sometimes... Something works, is still in production, and there's no compelling reason to change it.
What are the functional differences between a digital sampling 'scope and a digital spectrum analyzer? I'm interested in measuring the spectral amplitudes / frequency content of RF frequencies up to 30 GHz . This can be done using a digital sampling oscilloscope (I'll call it a SO) with FFT or a digital spectrum analyzer (SA) [or a fantastic digital storage 'scope, noted below]. As I understand it , a SO samples the signals directly with known sample jitter, then recreates the signal using regression. A SA , on the other hand, first downconverts the high-frequency signal with a mixer, then samples. It would seem that a SA should deliver greater frequency resolution given comparable ADC sampling rates to the sampling oscilloscope. What are the limits of functionality of each type? How is one better than the other at spectral analysis? (They both rely on the FFT, right?) What makes either expensive? Unrelated POIs: 32 GHz Agilent , 120 GS/s Lecroy , 100 GS/s Tek , Gameboy SA . edit: There seems to be some confusion between digital storage 'scopes (DSOs) and digital sampling oscilloscopes (what I called SOs) -- they are not the same, although they both sample digitally. I've also updated the question. <Q> Well, you're not going to be making RF measurements up to 30 GHz without spending a bunch of money, so either path is big bucks. <S> Typically, Spectrum analyzers are used to do frequency domain measurements. <S> You'll get a display of power vs frequency on the display. <S> The controls in the SA are setup for relevant things, Center frequency, bandwidth, resolution bandwith, signal powers in dBm/dBc etc. <S> Digital oscilloscopes don't directly have sampling rates to directly sample a 30 Ghz signal, so they'll undersample and assume that the signal repeats. <S> probably a safe assumption, although with no front end filters built into them, you've got dynamic range issues, as well as aliasing concerns that aren't present in a Spectrum Analyzer. <S> You won't directly get spectral plots out of a Digital oscilloscope, you'll need to do an FFT on that. <S> Now, that opens up a can of worms. <S> FFT bin width/windowing function selection, etc. <S> All stuff that can be worked through, but another question to deal with. <S> You won't get eye diagrams out of a spectrum analyzer, it's a useless measurement @ <S> RF. <S> That's a demodulated signal measurement. <S> Ultimately, if you want time domain data, then use an oscilloscope. <S> If you want Spectral information, use a spectrum analyzer. <A> The three main limitations are in the areas of span width, dynamic range, and spur rejection. <S> The span width of a modern sampling instrument is usually constrained by the sample clock rate and/or various throughput limitations of its baseband FFT pipeline. <S> Meanwhile, its dynamic range is lower than that of a classical spectrum analyzer because the front-end sampler 'sees' the whole DC-to-daylight spectrum worth of noise. <S> The instrument folds the noise at every harmonic of the sampling clock, so noise and signals near all of the resulting aliases are visible at once. <S> Using a sampling front end with an FFT baseband analyzer section is not a new idea -- check out the HP 71500A , and its main module, the 70820A introduced circa 1992. <S> (Large .PDFs but worth the wait.) <S> This 'microwave transition analyzer' was a bit too far ahead of its time due to the wimpy processing power available, but the concept is very sound, and it can be implemented very economically compared to a traditional microwave spectrum analyzer. <A> You use a sampling scope for repetitive signals, e.g. clocks and other signal-integrity issues. <S> You use a regular DSO (that is the correct term, not a SO) for most everything else. <S> You use a scope at baseband and a spectrum analyzer for RF. <S> The FFTs in scopes are for lower-frequency signals, not at RF. <A> This is a guess (I would have put this into a comment <S> but I don't have the points for it). <S> I would guess that Digital Sampling O-scopes probably use heterodyning to mix the incoming high frequency with a fixed carrier frequency, to bring it down to something more manageable, i.e. an Intermediate Frequency, just like a HF radio receivers do. <S> For instance if you mix a ~5.1Ghz incoming signal with a fixed 5Ghz carrier signal, you end up with a ~.1Ghz beat frequency signal. <S> (I've long since forgotten all the RF stuff my dad taught me years ago <S> so I may have that wrong) <S> I suspect SAs do the same thing, at least those capable of working with RF frequencies, anyway.
A sampling scope can indeed make a good spectrum analyzer.
How to interpret the output of a 3-pin computer fan speed sensor? I have a 3-pin 12 V computer fan and I want to interpret its speed sensor output. At the yellow wire I get something that looks like pulse-with modulation. How would I interpret the output without actually connecting the fan to a computer? <Q> Brief background: <S> The tachometer output comes from a Hall-effect sensor mounted on the motor driver PCB on the fan frame. <S> One or more magnets embedded in the fan rotor hub activate the Hall-effect sensor as they pass by. <S> The sensor is amplified, and eventually drives a logic circuit. <S> The fans that I have seen use an open drain/open collector output. <S> One (or more) pulse is generated every time the the fan rotor completes a revolution. <S> The number of pulses counted in one minute is directly proportional to the RPM of the fan. <S> In your fan's case, I think it would be reasonable to guess that there are two pulses generated for each revolution. <S> With the frequency that you have measured, about 1500 RPM sounds right, given that you are running it at 10V (12V nominal) and the typical is 1800-2000 RPM. <S> If you want a more visual approach, you can make a crude strobe tachometer using just a LED and resistor. <S> Connect a LED (brighter is better) and an appropriate current-limiting resistor between power and the tachometer pin. <S> If you mark one of the fan blades with something easy to see, like a sticker, you should be able to shine the LED on the fan blades and see the sticker illuminated in two places. <S> You can use this technique to count the number of times the tachometer output goes low each rotation, and to approximate the duty cycle of the signal. <A> All the needed infos are published here: http://www.formfactors.org/developer/specs/REV1_2_Public.pdf <S> v1.2 <S> https://www.glkinst.com/cables/cable_pics/4_Wire_PWM_Spec.pdf <S> v1.3 <S> and here https://noctua.at/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf <S> v1.3, including example schematics <S> More specifically, <S> Voltage 12 ± 1.2V Peak current (@13.2V) <S> 2A Tachometer section: <S> Speed reading: 2 pulses per revolution Open-collector or <S> open-drain type output Mobo has pullup PWM frequency: 21-28 kHz, target 25 kHz logic low: <S> <=0.8V <S> Imax: 5 <S> mA Vmax: <S> 5.25V PWM duty represents the speed output compared to full speed, linear relationship <S> If PWM is lower than minimum accepted value for that fan, undetermined behavior according to specs Fan should match <S> PWM control signal ±10% Rotor lock and polarity protections are expected Pins: 1, 2, 3, 4 are <S> black, yellow, green, blue and their function is GND, 12V, sense, control <A> Thus, for a minute times with 60 seconds. <S> Fan speed in RPM: $$RPM = \frac{freq}{2}*60$$ <A> In most fans that I've worked with, the yellow wire is referred to as the TACH or tachometer wire. <S> It is similar to PWM output but it is the frequency that is related to rotation of the fan. <S> Sometimes it is <S> 1:1 and one period output on the TACH line is equal to one revolution of the fan; sometimes there are 3 periods on the TACH to 1 revolution of the fan, you need to check the datasheet. <S> You can connect the TACH signal to an I/O pin on a microprocessor and determine the RPM value of the fan pretty easily. <A> The fan signal is the rate of rotation, 1 Hz = 1 RPS (rotation/revolution per second.) <S> Connect a PIC or your favourite brand of microcontroller to the signal, count each rising or falling edge in one (or however many you want - more seconds, more accuracy) <S> second and multiply to get RPM. <S> If your processor is fast, you could even measure the period of the waveform and from this determine the speed to a high degree of accuracy (1/t = f). <S> For most fans the 1 Hz represents one rotation, as it is more expensive to include multiple switches in the fan, but don't rely on this.
From fan pulse signal (tachometer) convert to speed by measuring the frequency of the tachometer which 1 full rotation of fan represent 2 pulse signal.
Recommended first steps with the BeagleBoard How can I easily start off professional development with the BeagleBoard XM? Which OS should I work with? .. my choices include: Ubuntu Android MeeGo WinCE QNX Angstrom (preinstalled) Symbian Gentoo How do I install an OS onto the board? Which IDE do I use? How do I debug or run my code on the target? I bought a brand new Beagleboard XM to interface to a camera module , capture video and do some image processing. The camera uses an 8-bit parallel port interface to transfer images. What do you recommend? <Q> I doubt that you will need to switch just to make the camera work. <S> I believe the OS for the Beagleboard XM is stored on the SD card, so if you decide you do need to switch to something else, you might get a second SD card, so you can leave the original OS intact. <S> Depending on the OS, you can probably find a prebuilt SD card image that will allow the Beagleboard to boot. <S> For an IDE, I would recommend starting with a text editor that works over SSH. <S> You might start with Nano, unless you've used Vim or Emacs before. <S> I'm not sure about debugging C++ on the Beagleboard, but you can start compiling in Angstrom with g++. <S> You'll be able to execute code from the commandline. <A> OS <S> It really depends on what you would like to do? <S> You have three options that is Linux kernel based: <S> Angstrom is a classic GNU/Linux distribution created for this type of devices. <S> MeeGo is the cool Nokia/Intel Qt based platform that will be used a lot in infotainments systems in cars (and in some Nokia phones). <S> Android the google phone OS, mostly Java And some Desktop Linux distributions: <S> Ubuntu <S> Gentoo <S> And then some other OS: <S> Symbian that is a 99% phone OS <S> (I would not recommend it) <S> QNX <S> I think is has some real time stuff that could be fun to play with WinCE <S> And you have the classic looked down Windows platform. <S> And I would actually start to play with the stuff in this order <S> Angstrom, since it seems to be easiest on the Beagleboard MeeGo since Qt is a really nice lib to work with Android since it is good to know QNX <S> But for the rest of this question I will only focus on the Linux based options. <S> Install <S> OS <S> It depends, but most of them uses the SD card. <S> But in debug mode you can use a combination that loads the kernel over tftp and the the runs the root filesystem over nfs IDE and debug To play the kernel you need the command line, a good editor like vim/emacs. <S> To debug the kernel you need a debugger to run over the jtag. <S> But for application development you could use the classical way (with a good editor and a lot of makefiles). <S> Or maybe something like eclipse. <S> Application debugging is usually done with gdb. <S> On the linux based you could use a normal text editor or maybe Eclipse. <A> I tried Meego and Angstrom, and settled on Angstrom. <S> It's far easier to make it work, and very stable. <S> The Meego port for beagleboard, on the other hand, had many glitches. <S> I didn't test the other OSes, but I'd say Angstrom seems to be the best choice for both community support and stability. <S> To install the OS is quite simple: you download an OS image to an SD card and make some changes in the bootloader to make it boot from the SD. <S> There are some ready-made OS images at the Angstrom website, along with recipes to install it on the SD. <S> Basically you'll create two partitions: a smaller FAT for the boot and kernel, and the other for the root filesystem containing everything else. <S> Here's one site containing instructions for SD boot: <S> http://www.xora.org.uk/2009/08/14/omap3-sd-booting/ <S> You could also make it boot from the NAND flash, but I'd recommend to save this option for later when you're more comfortable with the device. <S> Since the NAND is limited, you'll need to create a custom image using bitbake to make it fit, that's the kind of work you won't want to do right now. <S> About debugging, the best way is for you to buy an ethernet-to-usb interface + usb hub. <S> Then you run gdbserver in your beagleboard and can use any gdb-compatible debugging IDE at your PC (I use Eclipse CDT). <S> For the camera interface, the easiest way would be to use the GPIO pins at the expansion connector; the drawback is that you may have a limited frame rate due to the bandwidth limitation, and also yo'll make the processor busy while transfering the image; on the other hand the GPIO is so flexible that you probably won't need any additional circuit to connect them - <S> provided their voltage is compatible <S> (the GPIO works at 1.8 V). <S> There can be other ways if you want a higher frame rate and need the processor available for other parallel tasks, but I'd recommend to leave that for a second round of design.
I would start with Angstrom Linux, and then move to Ubuntu if you have to.
Mounting my PCB project My project Super OSD fits on a PCB with dimensions of approximately 40mm x 70mm. It's very space constrained and I can't expand the PCB too much. How should I approach this problem? I realise it's not strictly electronics, but it is a problem many have presumably solved before. I first considered screws but I didn't find any ones small enough - I need to go as small, or smaller than 4mm diameter. I was thinking of using heatshrink to keep the module secure if screws were not an option. Any opinions? <Q> I'd probably go for M3 or M4 stainless steel socket head cap screws. <S> They're strong, corrosion resistant, and readily available around the world. <S> If you google DIN 912 A4, (DIN 912 meaning a metric socket head cap screw and A4 meaning stainless steel), you'll find lots of suppliers. <S> One such supplier: <S> http://www.mcmaster.com/#din-912-a4-socket-head-cap-screws/ <S> I'd have those screws pass through nylon unthreaded standoffs and thread into whatever you're mounting the board to. <S> Here's what I'm talking about: http://www.mcmaster.com/#catalog/116/3240/ <S> You might also try snap-on plastic standoffs like these: <S> http://www.mcmaster.com/#catalog/116/3245/ <S> They're designed to snap into a 5/32" (3.97 mm) hole, so they should just fit. <A> Is there no open space anywhere on the board? <S> Remember that mounting holes don't have to go on the outside edges: you can put them in the middle if need be. <S> Is there open space around the edges of the PCB? <S> Alternately you can purchase supports that look like square columns with slots in them that will work as board standoffs. <S> I have even used double-sided tape to get a PC board to fit into a small area when I couldn't add space for mounting holes. <A> <A> Is this unit going to be provided for people to fit themselves or are you going to fit the unit into a specific model plane and sell it as a whole, or fit it for people in their planes? <S> Is this a fit-and-forget project or will it be fitted and taken out regularly? <S> I am wondering whether standoffs are a no-go because you'd have to fix the pillars into the plane and that will mean drilling holes - possibly on a non-flat surface or where the screws will show on the outside? <S> I also doubt self adhesive standoffs will survive the vibration and moisture/dust for very long. <S> If the unit is pretty much a fit-and-forget thing <S> then I wonder whether it could be secured with some expanding polyurethane foam (PU foam) around the base and edges - or even across the whole unit with masking (eg adhesive tape) left in place to allow slots to be formed for the connectors and switches - this would 'pot' the unit against environmental issues and avoid the need for a case. <S> The foam would give a vibration-tolerant mount and the unit could be cut out later with a knife if really necessary. <S> The only issues are whether the foam is OK on the plane's plastics and the customers accept this form of mounting. <S> Bonus: <S> No PCB land required for the mounting holes so you can make it even smaller! <A> I would propose designing your enclosure so that the board is seated in a groove on one end, and has a plastic leaf spring-like catch on the opposite side. <S> Gently pull back on the catch and then lift out the board when you need to remove it. <S> I'm coming from this standpoint since I have a 3D printer and can print pretty much whatever I need to fit around PCBs, but even if you don't have access to one, services like Ponoko and Shapeways can help you out.
Bud, etc., make enclosures with slots that a board can be placed into, but you'd have to have designed the board to fit an existing enclosure. You can get threaded spacers down to M2 - these are about 4mm dia
is the resistance in ten meters of copper wire too high to use in a circuit powered by AA batteries? I have a wireless security system at home, and the wireless node is too far from the receiver. I was thinking that I could splice about 10 extra meters of wire into the existing line to move the node close enough to the receiver. From my university days, I remember the I = V / R equation, meaning that with a fixed voltage (from the two AA batteries), if I increase the resistance, the current that gets through will be smaller - possibly not enough to power the wireless node. How do I determine the resistance of the wire? Is there a standard calculation I can use? I haven't picked up the wire yet, so I can use another type of wire and a small gauge if that would help. <Q> 24 AWG wire is 30.2 milliohms per foot. <S> 10 meters is 32.8 feet so 10 meters of 24 AWG wire is 990 milliohms . <S> But you actually have twice that, because the current goes from the battery and back. <S> So 2 ohms for wire resistance. <S> AA batteries have a series resistance of about 0.5 ohms new , and more as they age, so the circuit is probably happy with a little series resistance. <S> If the wireless transmitter draws a peak of 100 mA (a guess) <S> the voltage will dip an extra 0.2 V because of the wiring resistance. <S> I think it would work better with 18 AWG wire, which has about 1/4th the resistance of 24 AWG. <A> Resistance ( R ) is equal to the resistivity of the material ( ρ , Greek rho), divided by the area ( A ), times the length ( ℓ ). <S> The resistivity of copper is 1.68 × 10 −8 <S> Ω·m <S> I'd use a table to just look up what the resistance is, here's one I use occasionally . <A> You have to make that it's not too high. <S> Work backwards from the receiver's specifications and see what cable the system can afford. <S> You need to know the minimum operating voltage of the receiver, as well as its maximum current. <S> The AA batteries are probably not a good idea. <S> Rechargeables like NiMH have a low 1.2 V rating, so you don't want to get that even lower. <S> Alkaline cell energy is around a 1000 times more expensive than electricity from the wall. <S> Use a 3 V wall wart instead, and you won't have to worry about sagging voltage. <S> Say the receiver's minimum operating voltage is 2.7 V, and that it uses maximum 100 mA. <S> Then this 100 mA may drop maximum 300 mV (provided the wall wart effectively outputs 3.0 V). <S> Ohm's Law says a maximum wire resistance of 3 \$\Omega\$ is allowed. <S> Copper has a resistivity of 16.8 m\$\Omega\$ \$\cdot\$ <S> mm\$^2\$ / m, <S> and we have 20 m to and fro <S> , that's 336 m\$\Omega\$ \$\cdot\$ mm\$^2\$, then a cross section of (336 m\$\Omega\$ / 3 \$\Omega\$) \$\cdot\$ <S> mm\$^2\$ = 0.112 <S> mm\$^2\$ is the minimum required. <S> That's bit less than 0.4 mm diameter . <S> That's all non-USAers need to know. <S> USAmericans still have to lookup in a table what AWG value this is, or calculate it (involves a couple of logarithms). <S> Everything in one formula: \$ d = 2 <S> \sqrt{\dfrac{2 <S> L <S> \cdot <S> I \cdot 16.8 m\Omega \text{ } mm^2 / m}{\pi \Delta V}} \$ where <S> \$ d \$ = minimum wire diameter \$ <S> L \$ = <S> cable length \$ <S> I \$ = <S> maximum current \$ <S> \Delta V \$ <S> = maximum allowed voltage drop. <A> If you google "ampacity," you can find standard charts like this one that will help you figure out what current different size wires can handle. <S> But that won't really be helpful, as AA batteries are so small that most any wire you can buy will handle the current. <S> I'd just buy a small spool of 24 AWG wire and see if there's any voltage drop across the wire once it's installed-- <S> good chance it will just work.
To know if this is too much , one would need to know how much current you intend to draw.
Best way of making a trip-wire type device? I'm wanting to make a type of electronic "trip wire". My basic idea is to have like a laser and basically when the laser is interrupted then it sends some signal to a microprocessor. I'm not tied to a laser but it was the first thing that comes to mind. The attributes it needs to have is it needs to be only like a "wire"(as in, it doesn't detect motion anywhere but head on) and it needs to be low power(like run for a few days at least off of 2 AAs). Also, an actual wire is out of the question because it needs to be capable of being "reset" after a certain time out(of say 1 second or so) The range it needs to work with is only 5 or 10 feet though. Also, it's not possible to have two parts to this device like a typical laser-photodiode setup. This needs to be contained all in one (preferably small) package. What is my best bet with this? I was thinking maybe super-sonic sound like this but I think there would probably be a better way. So basically what I have in mind for the device is like when you first set it up, you "calibrate" it for a certain distance. So for instance if there is a wall five feet in front of it, then this device would work if there was anything that came head-on with it in 5 feet. And etc. <Q> There are multiple options for such a thing. <S> Your best bet I think is to use a PIR sensor like this one . <A> Your requirements: line-of-sight activation : this means focusing lenses & apertures for LEDs, or a laser. <S> self-contained unit : this means it must register a reflection from a variety of surfaces. <S> low power <S> : doesn't really limit implementations, but puts some design constraints on them. <S> There are two options: Infrared emitter and detector package , like the one linked in Matt's answer , but with a focusing lens or aperture or a small viewing angle. <S> Focusing lens, aperture, or small viewing angle is required to maintain directionality. <S> Focusing lens or aperture would be a pain in the butt, and could only be tuned for certain distance ranges. <S> Viewing angles as low as <S> 6 o are available. <S> Geometry will tell you what kind of directionality this gives you at a distance. <S> Laser and photodiode : Lasers are available with focusing lens and aperture for less than $5 each ; photodiodes are about the same . <S> I would use a visible one to make aiming it easier (but require bandpass filtering around carrier frequency to filter out ambient), but it's up to you: there are IR and (expensive!) <S> UV laser diodes. <S> It may take a bit of experimentation to develop an algorithm that filters out ambient effectively and detects weak reflections. <S> This guy did something like it. <S> Note that some surfaces will simply gobble up a visible beam (eg. <S> flat black). <S> For low power operation , use sleep modes, pull-up PMOS FETs for always-on devices, including voltage divider branches (stop current drain when controller is off ), and activate the sensor intermittently. <S> It doesn't sound like it needs to capture any fast single-shot events; going with 20km/h and 10cm objects, <S> a 0 o (perfect line) detector would get 18ms to react, or just over 55Hz. <S> You could wake-up every 10-15ms, check the line-of-sight a few times, then go back to sleep. <S> With a switching (or no ) regulator and some intelligent power budgeting in the design phase, you'll easily get this to run for days on AAs. <A> Use a 555 timer to output 38khz to an infrared led and use an IR detector to output a high signal when the led is pointed at the detector. <S> when the beam is broken, you can trigger an interrupt on the micro. <S> There are lots of details on this ladyada tutorial
Ultra sonic sonar PIR sensor, used in security systems
Using an Arduino to read data from serial device then send data over bluetooth So from a general high level standpoint I need to grab data from a serial device and then send this data over bluetooth. I have a bluetooth modem picked out. I understand how to hook it up to the arduino. I however do no know how to hook the a serial device that will talk to the arduino. It seems like I am trying to do too many simultaneousness serial connections. <Q> A serial protocol mostly uses a master/slave configuration with different addressing schemes: <S> SPI : Serial Peripheral Interface <S> ; pins often labeled MOSI, MISO, SS or Select, and S CLK or CLK . <S> Here is a library and user guide . <S> Pins 10-13 are used. <S> I 2 <S> C / TWI : Inter-Integrated Circuit / Two Wire Interface <S> ; pins often labeled SDA and SCL . <S> The library is included, called Wire , and here is a user guide . <S> Pins 4 and 5 are used with the Arduino Diecimila. <S> 1-Wire : <S> Actually needs two or more wires -- at least power/data and ground. <S> Here is a library and user guide or two . <S> Uses any free GPIO . <S> UNI/O : used with some EEPROM ICs from Microchip ; will likely have to write your own library . <S> U[S]ART : <S> Universal [Synchronous/] Asynchronous Receiver/Transmitter ; typically does not use master/slave configuration, only being used for point-to-point communication. <S> The library is built in, and there are extensions ( two ) and optimizations . <S> It uses pins 0 and 1. <S> USB : Universal Serial Bus ; uses a host/device scheme akin to master/slave. <S> Pins often labeled V CC , DATA+, DATA-, and ground or GND . <S> Although possible without , usually requires extra hardware and interpreters for 8-bit micros like the Arduino to use. <S> Ready-made Arduino platforms have USB-to-serial converter chips for IDE communication and extensions ; there are also some shields ( with libraries ). <S> PS/2 <S> : Personal System/2 connector , an old IBM PC std. <S> connector; pins are often labeled V CC , DATA, CLK, and ground or GND ; often made interchangeable with USB sockets. <S> Here is a library and guide . <S> Any GPIO can be used for DATA , but pin 3 must be CLK . <S> The library NewSoftSerial by Mikal Hart allows the user to implement an interrupt-driven software (as opposed to hardware, like UART peripherals) routine for serial communications. <S> Use it if you need to, but be aware that debugging clashing interrupts is more challenging than debugging polling routines (which is apparently what the default libraries do). <A> Maybe have a look at software serial - it allows multiple serial connections. <S> Any of the digital pins on the Arduino can be used for serial communication, and the normal serial pins can continue to be used for your bluetooth modem. <A> Yea, Using Software serial (as linked too, above) is your answer, it's fairly robust as long as you arn't doing to much other heavy stuff on the arduino at the same time and the baud rate is something sensible. <S> It's your choice if you use the hardware UART for the modem or the device, and which you link up to the software serial port. <S> I'm assuming you are using UART for the both devices, but if so, are you aware that you don't need an arduino in the loop? <S> I assume) <S> Jim <A> From what i remember, you should be able to use USART and SPI or USART and I2C on the arduino at the same time. <S> If you can give us more details on the Blue-tooth and the serial device, someone should be able to give you a definitive answer. <A> The quickest (though limited) method would be to simply connect the device you want to read from (assuming it's an async. <S> serial stream) to the AVR's RX, then the AVR TX pin to the BT module's RX pin. <S> You could then simply read from the UART, do whatever processing you want (or none at all), then write back out to the UART. <S> The major limitation is that the baud rate of the BT radio and your device must match. <S> You can adjust the baud rate on most BT radios, however. <S> You're also stuck with single-direction communications. <S> If you're doing no processing, you could directly connect them. <A> One simpler option would be to use a Bluetooth module with serial interface and hook it up to the serial line that you want to forward. <S> No need to add/program an Arduino.
just wire the device straight into the blutooth modem's uart in/out (make sure that both use TTL or otherwise compatible voltages) and you can pick up the data on the other end of the bluetooth link using SPP (as you would be doing anyway
What's needed to get 100 mA from a USB port? I'm trying to build a stereo speaker system for use on a laptop. I want to keep it as simple as possible, so I'm thinking of using laptop's audio output to for the audio signal and a USB port for power. As far as I know, each port should be able to provide 100 mA for devices. Is there any need to signal to the computer that I'm going to try to draw 100 mA, or is it acceptable to just connect the device? Also, how stabilized and filtered is USB power? I'm thinking of using TDA7053A to drive the speakers and its minimum voltage is 4.5 V. If that doesn't work, I'd use two TDA7052 amplifiers, but I'd like to keep number of parts as low as possible. As for power consumption, I already have a small radio which uses one 50 Ω speaker and a TDA7052 and it uses at most 25 mA, so even with two of those speakers, I should have lots of power to spare with a maximum supply current of 100 mA. <Q> The USB specification requires that a host port be able to source 100mA at a nominal 5V on the VBUS pin. <S> That much power is barely enough to allow some devices to enumerate on the bus. <S> (Early versions of the popular Cypress EZ-USB FX2 required a waiver because they drew slightly more than 100mA during enumeration.) <S> Of course, there is also an elaborate power management scheme that permits the host to shed loads by turning off ports individually. <S> (I've never personally seen power management implemented on individual ports: on systems I've examined carefully either all host ports are powered, or none are. <S> Your mileage will certainly vary.) <S> In particular, whether your ports are powered when the laptop is sleeping is more than a little OS, platform, and configuration specific. <S> For a device to consume more than 100mA, it is supposed to have permission, and to be able to gracefully handle being denied. <S> Similar rules apply to hubs, with complications for bus-powered hubs which are permitted to restrict downstream devices to only 100mA, while never consuming more than 500mA from the upstream port. <S> Edit: <S> I weakened the implication that PCs don't manage power per port. <S> Just because I haven't actually seen it happen has little bearing on whether it is found in the wild. <S> The white-box PC with an MSI MB that I was last actively developing a USB device driver on had fairly limited power management capabilities. <S> The brand new Dell on my desk seems to turn off individual PCIe cards under some conditions, so the world of power management in PCs has been advancing (or at least getting more complicated) steadily while I wasn't looking. <A> I haven't experimented with USB power, but this analysis seems to point to it working just fine. <S> At 100ma all tested devices remain above 4.5v. <S> I believe you can just connect to the port... you can test this simply by plugging in a USB cable and checking the pins on the other end with a multimeter. <S> Here's the full USB spec and here's all other docs from usb.org <A> The USB spec allows any device to draw 100mA from a port. <S> No communication with the host is required. <S> However, 500mA is available by communicating with the host unless you're plugged into an unpowered hub. <S> Many computers allow you to draw this 500mA without properly requesting it. <S> If this is a personal project, put a 10 ohm power resistor across the terminals of your USB port and see how much the voltage drops. <S> If it works, you're golden. <S> Just remember that it might not work if you plug it into a different computer. <S> If this is something you want to distribute, you'll have to tell the host that you want <S> 500mA. <S> If you don't have a micro on the project that can handle this task, the easiest way to do this is to put the cheapest USB hub controller IC you can find on the board, and configure it to do the communication. <S> The TI TUSB2036 is about $3, and just requires you to pull a pin high (Or low, I can't remember) to get the 500mA. <S> I think you'll want the 500mA to get a decent audio volume. <S> I don't know about the 50 ohm speaker you have, but in general, your power is limited to Vrms^2/R. <S> A pair of 50 ohm speakers operating from 0V to 5V will draw .125W <S> (assuming 100% efficiency). <S> That's hardly better than the stock speakers. <S> Four 8-ohm speakers will bring you up to a more respectable 1.5W of power, which is well under your 2.5W allowable power from the USB port. <S> If you're operating on a device which has a FireWire (IEEE 1394) port, you might consider using that as it has much more power available (Up to tens of amps, but possibly less. <S> Apple products guarantee that there's a minimum of 7W available, but the spec allows for as much as 45W of power to be delivered.
A device is permitted to draw up to 100mA without asking permission if VBUS is present. One reason for an external device to include a second USB cable for power is that effectively allows it to double its power budget.
Advice on cleaning up 5VDC from a wall-wart Assumption: I think it's generally true that commercially available AC/DC wall-worts can be expected to be pretty noisy (e.g. you can't count on much better than 5% stability). Background: I'm dorking around with an RF application right now, and I hypothesize that some significant subset of my headaches is coming from powering my RF receiver with 5VDC coming directly from an AC/DC wall-wart (i.e. no RF choke, no regulator, nothing). Question: What's the simplest way (e.g. fewest parts) and cheapest mechanism for converting the "angry" 5VDC off a wall-wort into a "happy" 5VDC for my RF receiver? I think the other subsystems are more tolerant to noisy power. Aside: I wish I could give more definitive characterization of the noise coming out of the wall-wart, but sadly I am sans o-scope. Edit1: In response to the request for more detail on parts being used: Wall-Wart RF Receiver <Q> The way to do this with the fewest parts - the only way to get 5Vdc from less than 5V - is to use a switching regulator. <S> There are a few options, based on how much current you need. <S> All of these can have inputs from ~1V-5.5V: <S> TI REG711 : <S> 1MHz; 40mVpp ripple; 50mA; regulation not listed. <S> Linear <S> LTC1754 : <S> 600kHz; 65mVpp ripple; 50mA; 4% regulation. <S> Maxim <S> MAX1759 : <S> 1.5MHz; 60mVpp ripple; 100mA; regulation not listed. <S> National LM2750 : 1.7MHz; 4mVpp-15mVpp ripple; 120mA; 4% regulation. <S> Microchip MCP1252/1253 : 650kHz/1MHz; 50mVpp ripple; 120mA; 2% regulation. <S> There are others that will give 140mA and more, but the linked RF widget doesn't need it, these were pretty cheap, simple because they're just charge pumps, take up little space and are entirely surface mount due to the high switch frequency. <S> Those with MHz switch frequencies are less likely to interfere with your 315MHz-434MHz project. <S> Easiest way to do it, in my opinion, is to get a different wall-wart! <A> I have never had noise problems with wall warts, but then again, I never trust power supplies either and always add at least minimal filtering on my boards. <S> I usually add a 10 - 47uF electrolytic in parallel with a 0.1uF cap at the power inlet "just in case. <S> " This has never failed to clean up any ripple or spikiness from wallwarts. <S> Is the power supply regulated? <S> Have you verified that the voltage is really 5V? <A> It's a switching wall wart. <S> It's bulky, but 50/60Hz won't give you any RF problems. <S> Switching wall warts can be noisy, and there is little filtering you can do about it in terms of RF. <S> All component filtering will do is filter conducted noise, not radiated, which is what could be your problem. <S> Also consider other sources of interference. <S> I have an RF remote that won't work anywhere in my house when I run my dishwasher. <A> An an alternative, turn an ATX power supply from an old computer into a benchtop power supply. <S> I can't speak for how clean the power is (I imagine quite good) <S> but it's a cool project!
The easiest solution may be to just get a linear wall wart, or even just a transformer and regulate the voltage at your board.
Interfacing microcontroller and mains via a relay I am thinking of starting a project where I will need to interface a microcontroller output and mains for a lighting system. My question is about relays. I have found this one . And I am wondering will it be ok to put 230v through the switch of the relay? Also what am I looking for in the data sheet to tell me what is the maximum voltage that the switch will take? <Q> The relay is a good one for resistive loads like incandescent lamps. <S> The AgSnO2 contacts can handle higher inrush currents than AgNi. <S> Note that all given currents refer to cos(\$\phi\$) <S> = 1, i.e. fully resistive loads. <S> You also want a safety margin for the inrush when switching a cold incandescent lamp when the voltage is maximum. <S> Your 10 A then become 1 A. <S> Since a 60 W bulb draws 0.25 A at 230 V you should be able to switch up to 4 lamps with 1 relay. <S> edit <S> Forget <S> I mentioned incandescent lamps. <S> I was in the supermarket today and I needed a replacement bulb. <S> While in the past there was an offer of at least 30 or 40 different incandescent bulbs in all sizes and shapes today <S> they were all gone! <S> Same variety in CFL (compact fluorescent), so that's no problem, but I didn't think the incandescent effectively would be gone before 1st January 2011. <S> Anyway, for your relay. <S> Relays like the resistive load of an incandescent bulb much better that the reactive load of a (compact) fluorescent lamp. <S> While in theory you should derate the relay further for the changed load, in practice CFLs are only 20% the power of incandescent lamps, so your load will remain within the limits set earlier: you should still be able to switch 4 CFLs with 1 relay. <A> If you are in any doubt about dealing with mains power - don't do it. <S> You might want to consider a ready made unit like this one from Adafruit: https://www.adafruit.com/index.php?main_page=product_info&cPath=44&products_id=268 <A> If money is no object, then the first thing I go to is a solid state relay (SSR), instead of the mechanical switch variety. <S> I've had to switch 120VAC with a DC control voltage many times in the past, and I've alwyas started with Crydom SSRs. <S> SSRs make interfacing with AC voltage really, really simple. <S> Crydom has several models that can switch 230VAC. <S> That said, everything I have used them in is for prototype and R&D automation. <S> It would be interesting to hear how others here feel about it. <A> I've done this kind of thing before, and it worked fine. <S> The relay you've chosen looks about right, and as long as your not switching a huge load it will be fine. <S> If your unsure about the load, then do a simple calculation, for example if your switching a 100w bulb on and off, then 100w divided by 230v = about 0.4 amps. <S> The datasheet says that the relay is rated at 10A... so its way more than enough. <S> If your calculations are out, and things go wrong <S> the worst that can happen is it burns out a cheap relay, or blows a fuse or MCB or something... <S> it's not the end of the world. <A> The Max. <S> switching voltage is apparently 277V AC and 30V DC. <S> What you should be asking however, is how much current you need to be rated for. <S> This is not a simple thing to answer because depending on the type of load you are switching, you actually need to derate the current differently to account for inrush current. <S> I suggest reading through Agilent Application Note 1399 - Maximizing the Life Spanof <S> Your Relays <S> to give you an in depth idea of what I'm talking about. <S> Don't mess around with this stuff without taking appropriate precautions. <S> You will note that for incandescant lighting, you need to derate by a factor of 10%. <S> That means if your lighting draws 5 amps, you better get a relay that can switch 50 amps. <S> I think the reason that incandescent lighting is derated so much is because when the filaments are cold, they have much lower resistance than when they heat up, and so draw a huge amount of current from a cold start. <S> I'm really just guessing at this though.
If you want to switch reactive loads like fluorescent lamps you're limited to a fraction of the given maximum current.
Sizing a trace on a PCB to carry 2.5 amps I need a trace on my PCB to carry up to 2.5 amps (average) current, with 5-6 amp spikes (it's going to a switch mode power supply.) How wide should the traces be? I've got a trade off between reliability and size, as the product is space constrained. Any tips would be appreciated. <Q> After doing a quick google of "PCB Current Calculator", I found a PCB Current Calculator based on IPC-2152. <S> It bases the width of the track on how much of a temperature rise the trace is allowed to have. <S> It's nice in that it shows how much power you waste through your trace. <S> I would design for your worst-case RMS current, since it's going to be a periodic signal. <S> For example, allowing for a 10 o C rise , you can get away with these numbers at 3 <S> A with no copper plane nearby: 177 mil (4.50 mm) on 1 / 2 <S> oz/ft 2 copper 89 mil (2.26 mm) on 1 oz/ft 2 (35µm) <S> copper 47 mil (1.19 mm) on 2 oz/ft 2 (70µm) <S> copper Note: <S> IPC-2221 (The standard used in the original answer) uses old measured values for its design charts, and these charts are implemented in many calculators. <S> As best as I can tell, this data was claimed to be 50 years old, which makes IPC-ML-910 (1968) a possible source. <S> As @AlcubierreDrive pointed out, a new standard, IPC-2152, contains new measured data, and presumably is more accurate. <S> More importantly, a comparison of IPC-2221 values gives the following result for trace widths: IPC-2221 (internal) <S> > <S> IPC-2152 <S> > <S> IPC-2221 (external). <S> Actual numbers for the example above (1oz copper) are IPC-2152: 89 mil IPC-2221 (internal): 143 mil (+60%)IPC-2221 (external): <S> 55 mil (-38%) Also note that the original numbers in this answer were based on the IPC-2221 internal calculations, which will provide a conservative estimate for all values. <A> Common practice for high-current devices is to solder thick copper wire on top of your 2-3mm trace.1mm^2 wire can handle 10A easily. <A> I remember having seen this nomogram in another answer : Select 2.5A on the vertical axis of the top graph. <S> Move to the line indicating the allowed temperature rise. <S> Move downward to the PCB's copper thickness in the bottom graph. <S> This intersection gives you the required width on the vertical axis. <A> Another option would be to use PCB Busbar soldered into the PCB - they would also add some nice rigidity to your PCB <S> should it need it
If you use 2 oz/ft 2 copper instead of the standard 1 oz/ft 2 copper, you won't need as wide of a trace to achieve the same resistance.
Flash a fluorescent tube Is it possible to build a circuit to make a fluorescent tube flash on and off for use as a lighting effect? If so, how? Also, if the above is possible, can it be used to flash more than one tube at a time without having to repeat the control circuitry for each tube? <Q> Well, first of all, you need to have electrodes hot all the time. <S> If you will try to heat them at the moment of pulse you will kill your tubes in a matter of hours. <S> Then you can turn on your main constant-current (ballast circuit) power supply for whatever time you need as long as it's fast enough to stabilize during your 1-10-100ms pulses. <S> You can use 1 constant-current device for multiple lamps if you connect then in series, but the required voltage will be much higher, so I believe it's cheaper to have 1 device per lamp. <A> You could try an EHT inverter circuit and avoid messing around with mains power, ballasts and starter circuits entirely. <S> In my case the fact that the tubes didn't glow at full brightness was not an issue. <S> I found this article which may be of use: http://talkingelectronics.com/projects/FluorescentInverter/FluorescentInverter.html <A> Perhaps use the LED-based tube replacements and a microcontroller of some sort to simulate the flashing patterns you need. <A> I was able to achieve a rapidly flashing fluorescent light during a stage talent show using a light dimmer. <S> You can buy one that goes in a wall socket if that's what you need. <S> At around 35% - 40% power there will be a certain moment where it just flashes extremely fast, any % other than <S> that it will just emit less or more light, depending on the %. <S> This is actually not very safe <S> and I don't have any idea <S> what long-term impact it may have on the ballast or the actual tube, but for me, it worked.
I used inverters salvaged from old fluorescent camping lights with some larger 4ft tubes for stage special effects a few years back.
Monitoring two serial lines at the same time First this is the setup: (please note that one of the grounds is not connected, both FTDIs working properly) Now, I have used PuTTY to look at these two serial streams, both exchanging data at 9600 bauds, but my problem is logging the activity time-wise. I've also tried some serial monitors that I found on the tubes, but the time resolution is in seconds. Is there a tool for monitoring these two streams at the same time? If there is not, I should program one myself in Processing (it will take less time in this language I suppose). PS: the ultimate goal of this is to replace the remote device (an actual wired remote) with a little MCU like the ATtiny85 or ATtiny2313 with a simulated input. PS2: I only have these two FTDIs, an analog oscilloscope and a multimeter. <Q> If you're on a 32bit Windows OS, I would recommend using PortMon . <S> It goes down to the millisecond at least. <S> It might even be microsecond resolution. <S> I've used it a lot in the past with great success. <S> In your particular case, you will put each FTDI chip on its own serial port. <S> Then in PortMon, simply select the ports you want to monitor from the pulldown menu. <S> Both sets of data get logged at high resolution, and you can even add filters to reduce the amount of data. <S> For serial protocol monitoring, I add the include filter IRP_MJ* . <A> I've used it before <S> and it's great. <S> Give it a try as well as PortMon. <A> Another option could be com0com or its sister project hub4com. <A> I wrote something like this explicitly to watch the conversation between my iPod and the iPod adapter in my car. <S> The source is here on GitHub . <S> It's pretty specific to the iPod protocol, but I need to be able to see the data being transmitted to and received from the iPod in real-time and match a response with its request as closely as possible. <S> This works quite well for me. <A> If you want accurate timing, you can't go to separate serial ports. <S> You need a microcontroller that can capture the data from both sources and output it to the PC at a data rate which is more than twice as fast as the data rate for the devices that are communicating. <S> Suppose the devices communicate at 115,200 baud and the PC connection is at 500,000 baud (a rate supported by the FTDI). <S> One could then, 12,500 times/second (every 80us), have the microcontroller output a 1-3 byte record, consisting of a header, and the lower 7 bits of transmit and receive data bytes (the latter only being included if present) <S> Header formats:10rrRttT - <S> Both bytes are present; RX byte received rr*20us after start of frame; MSB is R TX byte received xx*20us after start of frame; MSB is T11000rrR - <S> RX byte only is present; data as above11001ttT - TX byte only is present; data as above11111111 - Neither RX nor TX data is present; Next one or two bytes may provide a long timestamp Including a timestamp in the case <S> neither byte of data is present would avoid having to send 12,500 records/second at times when nothing was being sent. <S> Using an approach like this would allow far more accurate evaluation of data timing than would be possible using two separate serial ports (where timing resolution would be 1ms at best). <S> PC software would have to be prepared to parse out the data, of course. <A> This may be a time when scrounging the resources to buy an inexpensive USB-based logic analyzer is the right answer. <S> I recently acquired a USBee SX and have been very pleased. <S> Out of the box, it can decode serial on multiple (TTL level only) lines, and keep it all synchronized to well better than single bit time. <S> It has no internal RAM, so it pushes all the data it samples up the USB. <S> That has a couple of advantages, and at least one disadvantage. <S> A big advantage is price. <S> There's hardly anything inside the USBee SX between your signals and the USB, so it doesn't have to cost many arms and legs. <S> The biggest advantage is capture depth. <S> You are limited only by the storage on the PC. <S> If you need a one hour capture to catch an elusive timing window bug, it can do that. <S> A disadvantage is that the top sample rate is limited so that all sample can be fed up the USB. <S> This makes it less useful for high-end digital logic, but for serial communications protocols that really isn't a big deal. <S> The SX lists for about US$170. <S> At that price it doesn't have to save your company very many hours to pay off.... <S> It certainly isn't the only example of the breed, but it is the only one I've personally used.
Docklight is the tool you're looking for: http://www.docklight.de/
How much current does an FPGA consume, anyway? I'm in the R&D stages of a V4 of my project, which may replace the high-speed DSP with an FPGA. I was looking at this FPGA, because it is cheap: XC3S50A (about £6.50/each.) I think I can probably fit the project onto there, with one concern. I can't find anywhere in the datasheet about how much current it will consume. Is it a fixed amount, or does it vary, depending on how much logic I am using? Is there a quiescent current draw by it, when no logic is in use? What about the current draw by its clocks/PLLs? I've looked through the datasheet - it has many characteristics, but these ones in particular don't seem to be mentioned. <Q> It varies hugely with clock rate, exactly what is being clocked internally, and I/O usage. <S> It is sufficiently hard to determine that most FPGA softare has a utility to estimate current draw of a design given the external clock/data rates, however it will need a lot of detailed info to give a reliable estimate, so the easiest option is often to just build it & measure, or load a comparable design into a devboard and measure that. <A> There are two main "types" of power consumption: Static: the power consumed while the device is on but doing nothing. <S> The proportion of static power in the total power generally increases as technology dimensions shrink. <S> Dynamic: <S> the power consumed while the gates inside of the device (including I/Os) change state (i.e., got from 0 to 1 or 1 to 0). <S> That's why the operating frequency and functionality increases the accuracy of the estimate. <S> Xilinx has two tools for estimating power: <S> An excel sheet, as pointed by Brian Carlton. <S> A binary called 'xpwr' (part of ISE) that takes your placed-and-routed design (.ncd) and tries to estimate the power based on actual (well, predicted) use. <S> Obviously, the second method will be more accurate, but you could get a ballpark for your power budget with the excel sheet before you have a complete design if you need to design your board. <S> Of course, the best method is to complete your design, run it on a prototyping board, and then measure the consumption. <S> That rarely happens in practice, though, because the FPGA design and board bring-up usually happen in parallel. <S> (BTW, we're trying to start an SE site dedicated to FPGAs... consider supporting it... http://area51.stackexchange.com/proposals/20632/programmable-logic-and-fpga-design?referrer=YmxhQ2OJUo-FAaI1gMp5oQ2 ) <A> For that part the answer is here . <S> For other parts, Xilinx has this page <A> Looking at power use, there are two primary differences in FPGA types. <S> First, there's the SRAM-based families from the leading vendors like Xilinx & Altera. <S> They draw a lot of static power. <S> Too much, I think, to be useful for anything that's really "low power". <S> When these two companies say low power, they mean lower power than before (or than the other big guy). <S> The second class is non-volatile. <S> There's a few people with these, but Actel's probably the biggest company that I've actually seen in people's products. <S> They generally use orders of magnitude less static power. <S> They tend to be slower devices. <S> They're also highly resistant to IP theft. <S> I just went through this looking for an FPGA for a low power industrial temperature grade system I'm working on... <S> I want to use Actel <S> but I can't convince myself I'd be able to actually get the I-suffix parts when I needed them. <S> I still haven't really solved this problem. <S> I'll probably just try to squeeze the design into CPLDs. <A> It's true that the power estimation tools made by the vendors are the best tool to get information. <S> However, to get a feelinig, A "full" Altera Cyclone 3 <S> I have recently encountered uses something like 0.8 A on the 1.2 V rail and not much (1...50 mA) on its 3.3 V and 2.5 V rails. <S> It totals to a bit more than 1 W when running. <S> Since the 3.3 V rail is pretty much just used for the IOs, the FPGA will draw whatever the connected circuitry requires from this supply rail.
In 90 nm and below it is a significant portion that must be factored into the power budget.
Reading PDF through FPGA I am a newbie in FPGA world, working out on Verilog these days. I have thought of a couple of Projects for my FinalYearProject at my college. One of them is Handheld Ebook Reader. Well, I will workout the other things required, what i am most concerned about is, How am i going to read a pdf file through FPGA. Well, in the project, i will be interfacing a MicroSD card module with FPGA, the FPGA would read the file from pdf and would display it on LCD, interfacing with LCD wouldnt be a big problem as i have got a couple of good resources for that, interfacing the memory card module too. But the thought that has been troubling me in choosing this project is, how am I going to read PDF. I may work on the pdf which has texts only, i wont work on images, on the other hand if i plan to work on images as well, i will have to do a lot of work for several tasks, say for zooming in and others. Kindly help me on this. Plus, i am pretty keen about this task. Kindly tell me if this can be done more easily with microcontroller. I have a little bit of experience working with them. <Q> First of all you need to determine what you're going to do with the PDF. <S> If you're displaying it, you'll need some memory for the frame buffer, and a way to interface with the display. <S> That should be your primary concern. <S> Then, start thinking about rendering the PDF itself. <S> As PDFs are essentially compressed PostScript of one form or another with embedded fonts, you can divide your tasks into some major elements: part of the FPGA to load data from SD card or other media including file system access part of the FPGA to decompress chunks of data, or to accelerate this process part of the FPGA to decompress image data (JPEG, PNG, etc.) and copy to memory part of the FPGA to decode/execute PostScript part of the FPGA to figure out what needs to be displayed (such as the current page); this could be simple bounding logic or complex scaling logic handling a variety of different display modes a floating point unit for the floating point coordinates in PostScript an integer <S> ALU several "GPU" engines which render primitives from the PostScript engine (ideally, in parallel) e.g. draw line, draw polygon, ... a font engine or two to render fonts (this will likely be very complex as you will need to support complex features like hinting and antialiasing.) <S> a display interface and memory interface a UI controller of some kind, perhaps implementing copy/paste, selections, menus, etc. <S> Ideally the engines 1-5 would be pipelined to get maximum throughput. <S> You'll be looking at a big FPGA to do all of this. <S> You could probably do this on a CPU, but if you realllly want to do it on an FPGA, this is probably the route to take. <A> I'm not sure if images will make things harder; zooming in on text is hard enough as it is. <S> If you want to do things by FPGA <S> you definitely want a soft processor, i.e. a microcontroller on a part of your FPGA. <S> Decoding PDFs is not something you want to do parallel like an FPGA works. <S> FPGA suppliers like Xilinx and Altera offer IP for controllers, but the problem may be that a PDF library may not be available for them. <S> In this you'll have better chances with an external controller, which uses the FPGA as a display driver. <A> Put a CPU (some kind of micro-controller core) into your FPGA, and then program a PDF reader for that CPU. <S> Going this route, you might want to consider NOT doing PDF, but doing HTML instead, as that format is a bit more amenable to the sort of wrapping and re-sizing that you'll want to do on a reader. <S> There are any number of HTML rendering libraries out there that you could re-purpose to whatever CPU you embed. <A> As others have said, you probably want to do the PDF decoding as software on a soft-core processor. <S> One of the major requirements this will impose is that you are likely to need a number of megabytes of external ram, for both the program code and the data. <S> Also you will likely need more RAM than is available on chip in an affordable FPGA in order to form the video frame buffer for an LCD of a size worth displaying a PDF on (though a monochrome smartphone-size display probably would fit). <S> You'll either need to have dual port video memory or craft an arbiter to allow the processor logic to write to it <S> interleaved with the display logic clocking bits out. <S> Frankly speaking, an e-reader is not a good FPGA appliction, it's a system-on-chip one, architecturally very similar to a smartphone. <S> One might add a cheap fpga as a pin-remapper to make the same PCB usable with a variety of commodity LCD glass modules, but the logic belongs in a nice modern ARM core or similar. <A> An FPGA is really not the right device to do this sort of task. <S> There are CPUs with all the required peripherals to do the job (e.g.LPC2478) which will be cheaper and draw a ton less power. <S> If you want to do it with an FPGA as a learning excercise, I'd suggest you break the task down and start off By making your life easier by preprocessing the book content on a PC into a file format that is easier to display than PDF, e.g. uncompressed bitmap or run length coded bitmaps. <S> And start off using a simple block-oriented filesystem, as doing FAT stuff on an FPGA will be quite complicated. <S> That way you should be able to get something working reasonably quickly, then look at doing more complex stuff like other file format etc. <S> later. <S> If you start off trying to do it all, there is a high chance you will spend a ton of time and have nothing working to show for it when you get bored or run out of time. <S> At some point you definitely will need to using be using a CPU, either external or on the FPGA.
Theoretically, with enough memory, any processor could be made to decode a PDF... it just may be slow in operation and painful to develop if you have to write it from scratch.
What is a pinout of TOP side of Intel Core i7? Here is a core i7 cpu It has some contact pads on the top side, some grouped in 4 or 6 and two big groups.Is there a pinout of these pads? Where are the JTAG connection pins? <Q> TAP is on the bottom side. <S> AH10 TCK, AJ9 TDI, AJ10 TDO, AG10 TMS, AH9 TRST# <S> TCK <S> I TCK (Test Clock) provides the clock input for the processor Test Bus (also knownas the Test Access Port).TDI <S> I TDI <S> (Test Data In) <S> transfers serial test data into the processor. <S> TDI provides theserial input needed for JTAG specification support. <S> TDO O TDO (Test Data Out) transfers serial test data out of the processor. <S> TDOprovides the serial output needed for JTAG specification support. <S> TESTLOW <S> I TESTLOW must be connected to ground through a resistor for proper processoroperation. <S> TMS I TMS (Test Mode Select) is a JTAG specification support signal used by debugtools. <S> TRST <S> # I TRST# (Test Reset) resets the Test Access Port (TAP) logic. <S> TRST# must bedriven low during power on Reset. <S> UPDATE: here are some adapters for i7: http://www.asset-intertech.com/products_interposers.htm Intel® Core™ i7 processors and the Intel® Xeon® processor 5500 series use LGA1366 sockets, similar in design to the LGA775/771 sockets. <S> However, the high speeds of these processors mean that the use of an interposer between the socket and the CPU could interfere with signal integrity. <S> Intel has therefore provided pads on the top side of the CPU, which mirror the required signals. <S> To access these top-side pads, ASSET has developed a top-side probe. <S> The LGA1366 top-side probe consists of a PCB with a ring connector attached below it that contains small, spring-loaded probe tips. <S> These tips make contact with the CPU's top-side pads, allowing the debug port signals to be broken out onto a flexible cable, which terminates in a small PCB carrying a Intel®-specified XDP header. <S> The standard socket load mechanism is used above the probe's PCB to depress the CPU into its socket. <S> The heatsink and fan are mounted onto a heatsink location plate supplied with the probe. <A> Your question can be easily answered with a continuity tester (which most voltmeters have).The below pinout is for an i3-540 (LGA1156). <S> I connected one voltmeter probe to the jtag pad on the underside of the processor. <S> Then I swept the other voltmeter probe across the top side of the processor until the voltmeter registered a continuity. <S> TOP SIDE OF PROCESSOR: | 1 <S> | 2 | 3 <S> | 4 <S> | 5 <S> | 6 <S> | 7 <S> | 8 <S> | 9 <S> | 10 <S> | 11 <S> | 12 | 13 || <S> |AL31* |BPM4 |BPM1 |BPM0 | <S> |AL31* <S> |TDO <S> |TRST <S> |PRDY <S> |TAPPWRGD|AL31 | || | <S> |BPM6 |BPM7 |AL31 | |TCK <S> |TDI <S> |PREQ | | <S> | <S> | <S> || <S> | <S> |BPM5 |BPM3 |BPM2 |TMS | | <S> | <S> | <S> | <S> | <S> | <S> | <S> *Connected to BLCK_ITP# (useless since shorted)AL31 refers to Vss CPU <S> IS <S> UPSIDE DOWN(ie Intel Made in Malaysia and S <S> /n <S> Upside down) <S> I will be interested if you could find the pinout for the i7 or perhaps we could reverse engineer the Intel JTAG protocol. <A> Why do you want to do this? <S> Do you know you need to provide this chip with about 1.1V @ <S> 10 amps (up to 145 amps at full load) for it to even work, and that all signals have to be at this same level? <S> Likely, the pins are not documented. <S> Here is the datasheet .
The pins don't seem to be documented in that datasheet, and it's likely they are for factory specific testing (i.e. testing maximum operating frequency so they can bin chips into the various speed grades.)
How do I charge a commercial lithium battery with solar cells? I have a digital camera (Panasonic DMC-FT1) and will be going multi-day hiking with it soon. I'm looking to build a solar charger for it using something like this and strap it to my pack. Does anyone have any experience doing something like this, or any pitfalls in general that I may fall into (ie will my battery explode if I do xyz) ? There will be plenty of sun on my trip. Battery markings: Model: DMW-BCF10E 3.6V 940mAh 3.4Wh Li-ion Charger markings: Model: DE-A60A Input: 110-240V~50/60Hz 0.2A Output: 4.2V 0.65A <Q> You'd probably be better off taking a bigger spare battery. <S> But if you really want to charge using solar energy, you have to understand that there isn't much. <S> If you have a 3cm^2 solar panel and go on the basis of 15% efficiency for the solar cell (which is pretty good), then plug that into the solar energy per square meter on Earth, which is from 1,413 to 1,321 W/m^2, which gives you about 59mW. <S> Your battery is 3.4Wh, so it will take over 2 days to recharge it, nevermind that the sun is only around for a fraction of that or conversion efficiency. <S> Working backwards with those numbers, if one wants to charge a 3.4Wh cell within 4 hours, they would need a (3.4Wh)/(4h)/((1321W/m^2)*0.15)=43cm^2 solar cell. <A> I think they are actually a fire-hazard when overcharged. <S> You're also not supposed to "trickle-charge" Li-Po batteries. <S> They require a pretty specific charge cycle characteristic from what I understand. <S> Basically, what I'm saying is I don't think you want to DIY when it comes to Li-Po battery charging. <S> I used them once before, on an academic high-altitude ballooning project, and we were required to charge them in a metal enclosure because of the fire hazard, even though we were using a commercial charger. <S> Also on a somewhat unrelated note, I believe they are also pretty sensitive to being discharged to lower than 3V, and will not recharge if you take them down too low. <A> good app note here if you want to build your own http://www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1003,C1037,C1078,C1089,P89360 <A> Just in case could matter to someone, I've been recently experimenting with LIFEPO4 used batteries charging over a 2*50W solar panel and, realized that they weren't as dangerous as LIPO batteries <S> , I connected four of them in series (3.7V*4) and those to a big lead acid battery in parallel. <S> This one would provide enough stability during the charging process AND overcharge protection, limiting roughly at 15V peak. <S> As for LIPO batteries I've been thinking to experiment with a portable 12V/10W solar panel. <S> The idea behind could be pretty much the same, using a simple 7815 or 7915 for limiting the voltage at 15V. <S> According to specs, 10W panel would provide 1A peak, about 0.5C of commercial stick batteries (those normally found on laptops). <S> This latter could be the solution for portable (backpack) application for many of us.
I have read that Lithium Polymer batteries can, in fact, be dangerous.
Can I run traces through "No Connection" pins? Several ICs are manufactured in packages with more pins than it supports. For example, the LM317 in an SO8 package has 4 V OUT pins and 2 N/C (no connection) pins. I often want to run traces through N/C pins to ease routing, but wonder if it would make them give up the ghost. If it exists, what is the standard or rule by which manufacturers follow concerning the electrical characteristics of N/C pins? Or do I have to scour the datasheet / do my own testing every time? <Q> It's a grey area. <S> Some manufacturers tell you that's used for calibrating. <S> Some manufacturers even will tell that you that certain pin has a function, only used by them for calibrating. <S> You can't know for sure. <S> The datasheet is information the manufacturer want to tell to you about using the device, but it might not be everything. <S> I recommended you do not connect them. <S> If you get some generic IC from a different manufacturer or even batch the behaviour might be different. <S> If you're engineering a project, you don't want to throw in unpredictability. <S> You would have to test every single batch before you're going to use that particular batch. <S> It depends on whatever you want to do that. <A> Normally "n.c." means that the pin is not connected to the die, and you should be safe running a trace over it. <S> In some rare occasions I've read "n.c. DO NOT CONNECT" , which rises the question why I shouldn't, if it's not connected internally anyway. <S> One example is pin 4 on the LP2981. <S> Texas Instruments says "Pin 4 (NC) must be left open. <S> Do not connect anything to this pin" , without further explanation. <S> National specifies: <S> "Post package trim. <S> **do not <S> ** connect to this pin" . <S> So the pin seems to be connected as expected, otherwise it would be safe to connect. <S> In this case "not connected" should be read as 'no end user connection" . <S> Both manufacturers indicate clearly not to connect. <A> If you must do it, at least check an actual device with a meter - check resistance between the pin and +ve and the pin and ground using both polarites on the meter - if this shows infinite resistance it probably isn't bonded and is safe to connect. <A> Sometimes. <S> On the TDA89xx, the recommended layout has traces routed through the NC pins.
Some tell you only not to connect it, or just say it's an unconnected pin.. In any case I expect the datasheet to mention it expressly when I shouldn't connect to the pin.
Cheap 1" LCD suitable for use with microcontroller? What cheap LCD pixel displays are available which are 1" or smaller which could be interfaced to a microcontroller? (AVR, PIC24, etc.) I'd like to make an interactive keyfob. The important factor is small size, 1.5"^2 maximum. I've seen small colour displays in LCD keychains which look ideal - but, it looks as though they use some custom controller logic which only talks USB. Something like these 16x16 monochrome LCDs would be ok, if I could find a display controllable with SPI (this device has a custom epoxied blob). http://img.skitch.com/20090406-8dargu3hrnwdnfpgdu35k3tu78.jpg Any ideas? <Q> A guy named Rossum (known for the world's smallest, cheapest game console [ prev url ]) did a nice job of reviewing and reverse engineering lots of cheap LCD displays [ prev url ]. <S> In his latest post he reverse engineered <S> an iPod Nano 2g display [ prev url ]. <A> Sparkfun sells these: http://www.sparkfun.com/products/569 <A> Could you not salvage one from an old nokia(or other phone)? <S> Such as the 3310. <S> This instructables has a nice tutorial on the Nokia LCD and ATMega8. <S> Just found this site that has useful information on sizing and pin layouts for the screen. <A> Does it have to be LCD? <S> I have gotten them from http://www.osddisplays.com/ <A> I usually check EarthLCD to see what they have available. <S> They tend to have a pretty good selection of small LCDs, and I have purchased many from them in the past. <S> I can't really comment on how good their prices are, but they at least have what I need. <S> They don't have any in stock right now, but I purchased a 1.5" color Seiko LCD from them before, part <S> #RNH942209R1A. $15. <A> Perhaps you could use a "programmable display pushbutton" as a combined display and user interface. <S> http://www.sparkfun.com/search/results?term=screenkey&what=products <S> http://www.nkksmartswitch.com/ <S> http://www.nkkswitches.com/SmartSwitch-Development-Tools.aspx <S> They are extremely small. <S> They can be programmed with 4 wire SPI.Alas, they are not exactly what I would call "cheap". <S> Still, fulfilling 2 out of 3 wishes is pretty good ...
I have used some OLED displays with a micro-controller before.
A better power supply for microcontroller circuits I've been playing around with PIC microcontrollers for a while now, and have had a fair bit of success, however I sometimes get unexplained resets and sometimes need to cycle the power a few times to get my device to start working. I think this is down to my simplistic PSU. I normally throw together a mains transformer, bridge rectifier, linear regulator and a few capacitors. Does anyone have a circuit diagram of a better more efficient PSU that is easy to build on stripboard and doesn't cost too much? <Q> It's not on stripboard, but it's simple, cheap and decent. <S> http://www.ladyada.net/make/bbpsup/ <S> Project files: <S> http://www.ladyada.net/make/bbpsup/download.html <S> (source: ladyada.net ) <A> What is REALLY important is to have 0.01-1uF ceramic capacitor soldered right on the power pins of every digital IC in your circuit no matter what is the power source. <S> So I belive even your current PSU will be fine if you add ceramic caps where needed. <S> Linear regulators provide very stable power, so you should be good with what you have now (unless it is oscilating - might happen if ESR of caps does not match regulator requirements - usually happens on LDO regulators rarely). <S> In my projects I use USB as my main power source. <S> It gives you stable 5v and it does have current limiter. <S> You can ether get it from your PC(should <S> be careful a little) or from tiny mains adaptors which have USB output. <S> Then you use your linear regulator if you need less then 5V. <A> How stable is the power supply's output when you connect it a volt-meter (multimeter)? <S> Is it quite close (less than 10% error) to the nominal value? <S> (e.g. 5.06V for a 5V supply is good) <S> For example the 7805 linear regulator requires an input voltage of 2 volts higher than the output (i.e. 7V input), and I like to add 1V as a margin of tolerance to make it more reliable. <S> Adding the voltage drop of the (diode) bridge rectifier (1.4V), you want 9.4V peak-peak Vac from the power transformer. <S> That works out to around 9.4 / sqrt(2) <S> = 6.6 or 7Vrms AC. <S> So a 6Vrms rated transformer would work most of the time, but does not have much (sufficient?) <S> margin of tolerance (AC mains may vary by 10% from nominal value, e.g 108-132 for 120Vac) to withstand potential AC main voltage drops. <S> Ref: <S> Electronic Circuits Design For Beginners - Chapter 1
One potential addition source for glitches caused by the power supply, would be if the power transformer's output voltage is too close to the necessary input voltage of the linear regulator.
Communicating between PICs over 30 feet I have a PIC24F based device that normally connects to a PC via USB. The device can be controlled through PC software this way. I want to add an optional hand control box that can also be plugged into a separate connector on the main device and can be used to control the device and read/display data from the main device. This hand control box will also be PIC based. I am trying to decide which communication technique to use between the main device and the optional hand control box. I like the idea of SPI but I know that is not intended to be used over long distances. Do you think my best option would just be to use the UART modules with RS-232 line tranceievers to boost the signal to +/-12 volts? Are there really any other options? <Q> One option (assuming your desired device supports it... <S> many Microchip PIC's do) is a CAN messaging system. <S> It's extensively used in automobiles, e.g. so a tire rotation speed sensor and an accellerometer can communicate with the airbag computer. <S> The protocol is designed such that you can have an unlimited number of devices communicating on one bus without collisions. <S> I use it at my company to communicate up to about 200 feet between a product and a controller. <S> Highest standard baud rate is 1Mbit/s. <S> It's fairly easy to implement in C. <S> You'll need a CAN transceiver if you choose to do this; something like Microchip's MCP2551. <S> Here's the specification , here's pertinent app notes AN713 and AN754 <A> I've implemented the DMX protocol used for theatrical lighting systems which is a flavour of RS-485, and this worked in a noisy environment at least as far as 100ft. <S> This was using a PIC16F877A and a RS-485 line driver to transmit, and several other receiver units with the same microcontrollers, daisy chained together along the 100ft line with a terminating resistor at the end.... <S> it worked well. <S> Microchip actually has a very good datasheet on the subject with some circuit diagrams and example assembler code. <A> There are many software protocols that use this physical layer. <S> Modbus is one of them that I've used in the past. <S> It's very simple to implement and there are lots of industrial controllers out there that support it. <A> Yes, RS232 will work. <S> Keep the baudrate nice and low, and 30 feet is no problem. <S> But long cable runs are a hassle, so wireless seems attractive. <S> Especially since a quality 30' RS-232 cable costs some money. <S> Other ideas to consider: if one way communication is acceptable, put an IR receiver on the box and program it to listen to a consumer IR control. <S> if you control the host software on the PC, have it open an ethernet port and serve web pages with the desired functions and controls on them. <S> Any wifi-enabled iPad or smartphone becomes a remote control, and remote monitoring is easy. <S> You could even replace the USB with an ethernet port, but that will add some complexity to the box. <S> Look at the ISM-band wireless modules like the 24L01 stuff from Nordic and the CCxxxx parts from TI. <S> Sparkfun sells some on modules. <S> If this is for a real product, using FCC precertified modules can save some money because FCC cert is expensive. <S> I would say modules make sense in product volumes up to 5000 pieces. <S> Edit: <S> You should use this remote. <A> I have used these, RF Link 4800bps Receiver - 315MHz and <S> RF Link Transmitter - 315MHz <S> i have 2 different frequencies one for send and one for receive. <S> I have successfully used them up to 30 feet using 5v to power them. <S> Sparkfun has other wireless communication devices as well. <A> There are various ZigBee devices that can be used just like a UART and should be simple to control from a PIC device. <S> For example, the XBee is quite easy to use and is very affordable. <S> In my opinion wireless is much preferred to a 30-ft. <S> long cable! <A> The MIDI interface was designed to reliably communicate over 50 feet. <S> The hardware required (an optoisolator and a diode and a few resistors and an IC or transistor inverter) costs less and has better performance over long lines than the hardware required for +/- <S> 12 <S> V RS232 communication. <S> official MIDI interface schematics beautiful MIDI IN schematic
Use a popular remote's codes so that an $8 universal remote will work. RS-485 will work well, but you will need to add a RS-485 transceiver between your UART and the RS-485 bus. In my experience I've been able to transmit and receive data in a crowded office at distances greater than 100 ft, and in a wide open space we could do much better, especially with good antennae.
How long can I leave components in a breadboard? In school, I was told not to leave components in a breadboard for extended periods of time. However, this length of time was never quantified. The reasoning was that the contacts would eventually lose their "springiness"; at some point later in time, you'd be debugging issues with a circuit, only to find out that the contacts were bad. I have no idea if this is really true, or if breadboards are now made so well that it's not an issue. I have some nice ones, but in the end they seem to use the same narrow white piece that everyone else uses. I've got some prototypes put together that I don't want to take apart yet, and I also don't know when I'll get back to it. My mbed board has now taken a back seat to the Netduino that I just received. :) <Q> Here's a picture of a board which had some headers forced into it which were too large, damaging the contacts: <S> The outer rows of the Sharpie'd area make intermittent contact, so we avoid the whole section. <S> Notice that some of the numbers are rubbed off, and also notice the burnt spot at the top of the picture where something burned up. <S> The breadboard still has two other middle sections, and this section is only 20 rows tall, so that leaves 172 good rows. <S> On a university budget, that doesn't merit replacing the board. <S> If you are demonstrating breadboarded circuits to a client, you should probably replace the whole thing. <S> By the way, this board is at least 8 years old, and still works fine except for the indicated area. <S> I've only been around it for three years, but no one has had any problems with it that I've heard of. <A> Addressing the matter of "losing springiness", or more technically setting the springs by exceeding their yield strength, all that really matters is how much stress (pressure) <S> you subject them to, which will depend on the strain (displacement). <S> Over a very long time, they may take a set, but it would take years or extremely elevated temperatures. <S> Basically, avoid inserting extremely large component leads <S> (diodes are the most common offender when breadboarding I think) into the holes. <S> That's your enemy, not time. <A> I've never had any problems, and I've left components in the board for months. <S> Component leads seem to be quite a tight fit anyway, so whether it's springy or not I think it will make contact anyway. <A> I'm mostly using common sense here, but let's see what would happen to a board when it's left with components in. <S> Oxidation would occur even with no components. <S> Probably some parts of the springs would oxidate differently without components than if components are in, but contact surfaces would probably be more exposed without components in, so I don't think that having components in would make more bigger impact then just having board sit in same conditions without any components. <S> Next, let's take a look at problems which could come from components themselves. <S> Most components don't produce any debris by just lying around, so only problem could be bad electrolytic capacitors which could leak and contaminate the board. <S> Maybe broken LCD could contaminate board too? <S> I can't think of any other components which leak at the time. <S> If we take a look at the contacts themselves, cold welding could cause problems if the components need to be removed and board repurposed for another use. <S> I don't think that cold welding would cause problems with signal quality on the parts which were left there and allowed to weld, because that's what we use for standard network cables and it works. <S> How big problems this is would depend on materials used for springs and component leads. <S> I really don't know what happens to springs which are left in a certain non-relaxed position for extended periods of time, but there could be problems with that. <S> But then again, I think that springs would wear out more by inserting and removing components. <S> In the end, I don't think there would be any reason for anything bad to happen if prototypes do remain assembled on a breadboard. <S> Since the myth comes from a school, maybe the biggest issue would be simple mechanical damage and problematic storage of breadboards. <S> Also, it would be difficult to stack populated breadboards. <S> On the other hand, I don't see anything breadboard specific here. <S> Same rules would apply to any other type of prototyping board. <A> You could see a issue with oxidation. <S> Usually removing and reinserting the wire or component will "wipe" the oxidation on the contacts. <A> As I understand it, springs only wear out when they move. <S> Leaving them loaded, or leaving them unloaded should be fine. <S> What you'd want to avoid is unnecessarily unloading and reloading them. <A> In a past life I breadboarded a 555 timer circuit together. <S> The circuit did splice detection on a Asphalt roofing line. <S> The area was subjected to high humidity. <S> The circuit ran flawlessly for 10 years until they shut the plant down - otherwise it may still be running today. <A> I have friends who have permanently-constructed projects using breadboards. <S> In this case, it was a audio crossover, and it had been assembed on a solderless breadboard, the wires were given some additional retension by being glopped down with hot-glue, and the whole thing was stuck in an enclosure, and then used for years without issue.
As far as I see it, components are exposed on top of a breadboard and can be damaged very easily. I would only worry about the "spring" if you are using over size leads. If the components are removed, contact surface of the springs could be damaged or contaminated by remains of the weld.
Spin two wheels in opposite directions with single DC motor? I'm using a simple DC motor and the wheels from a small toy car to build a basic ping pong ball launcher. I've got one of the wheels rotating clockwise, mounted directly on the motor's spindle, and the other wheel is free running (with 40mm distance between the two outer rims). So it does sort of launch the ball, but because one wheel is not connected to the motor it has a real large side spin. How would I connect the second wheel to the same motor so that it spins in the opposite direction? <Q> Four wheels would reduce the load your bearings need to apply to keep the shafts aligned; just put the small wheels in the middle. <S> Alternatively, you could just forgo the second axle altogether, and spin the ball against a static plate. <S> It would have a lot of spin when launched, but that might be useful, especially if you can get backspin on it <S> so it curves upwards in flight. <A> Another (easier) option than gears is a figure-eight belt. <S> Basically, it's the same as a normal belt, but the belt crosses between the pulleys. <S> It also works with v-groove belts, and round belts, assuming they slide over themselves easily. <A> You also could use a second motor, if you have the room on your project, <A> Sorry I don't have a way to illustrate this, but here goes .. <S> Assume your two ball-launching wheels are in a horizontal plane. <S> Now imagine that the DC motor is under one of the wheels, with its shaft also horizontal, but in line with the two ball-launching wheels' centers, so if you put a small wheel on the motor's shaft, it will be upright. <S> If this small wheel contacts one of the ball-launcher wheels, it will drive it, sort of like a bevel gear. <S> From here, you should be able to see that if you put two such drive wheels on the motor shaft, such that each contacts one of the ball-launching wheels, just either side of the gap between the launch wheels, then the launch wheels will turn in opposite directions, i.e., in the gap, the rims of the launch wheels will go in the same direction, thereby projecting the ball out of the gap. <S> Well, ok, here's some questionable ascii art. <S> You are looking at the business end of the machine, the ball comes at you from where the '*' is. <S> The launcher wheels are seen horizontal, rim-on, on top, and the drive wheels are also seen rim-first, but are vertical and below. <S> =====|===== * =====|===== <S> -|-----|--[motor] <S> Note that if you do it this way, you can vary the relative speeds of the launch wheels by varying the contact points with the drive wheels. <S> If one drive wheel is 10cm from the axis of its launch wheel, and the other drive wheel is only 9cm from the other launch wheel axis, the ball will get some side-spin.
You can connect the two with gears, or, since the ping pong balls are light weight, just find a pair of wheels with a diameter about 40mm greater than your current wheels and let the friction play the role of gear teeth.
What are the cheapest microcontrollers? What are the cheapest microcontrollers available? This would be in volumes over 1000, though hobbyist availability would be nice. I'm looking for the cheapest of all microcontrollers - my requirements are minimal, 1 IO pin, any supply voltage, single chip. (This is a "community-wiki", so anyone with >100 reputation can refine and improve answers) <Q> Given your modest requirements. <S> the pic10f200 is worth a look. <S> Flash: <S> 256B RAM: <S> 16 B Package: SOT23-6 Price@1: $0.41 Price@1k: $0.32 Datasheet <A> Texas Instruments have a " Value Line " MSP430 range. <S> Flash: 0.5/1kRAM: 128 BPackage: 14TSSOP (cheapest) / <S> 14DIP / 16QFN <S> It's the only 16-bit device in this class, and it's also the only one with 10 IO pins. <S> The MSP430G2001 is $0.34 @ 1ku . <A> Especially when you're talking small quantities the price of the controller is only part of the picture. <S> Suppose you need a 500 euro programmer to program the devices. <S> This is OK if you need 100 000 devices a year, but if you need 50 controllers, the programmer adds 10 euro to a device which at 1 euro may be cheap in itself. <A> The 6-pin (SMD) or 8-pin (DIP) <S> Freescale MC9RS08KA1 , is <S> 68 cents quantity one <S> ( 72 cents quantity 10, and 42 cents quantity 100 , or 40 cents quantity 1000 . <S> It has 2 or 4 I/ <S> O pins, and has 1 KB of Flash and 63 bytes of RAM. <A> Atmel has a 6-pin SOT-23-6/DFN-6 line of AVRs, the ATtiny4/5/9/10 . <S> Flash: 512 B (4/9) / 1k (5/10) RAM: <S> 32 B Package: <S> SOT23-6/DFN-6 Price@1 <S> : <S> $0.95 Price@4.5k: $0.53 The 4/9 parts have no ADC (and are cheaper), the 5/10 parts have ADCs. <S> The ATtiny4u3 has an integral boost regulator and runs from as low as 0.7V, which might save some money if you're running from a battery. <S> If course, the extra features cost more. <S> From what I've heard though, Atmel has legendarily bad availability for production quantities. <A> While the answer I give on this occasion is the same as others have given <S> (= try Microchip PIC 10F200) <S> the ease of getting a reasonably good answer out suggests that you are not aware of it <S> so it's worth noting. <S> ie use any large suppliers online priced selector guide - in a competitive market <S> they are as good as you'll be easily able to get at 1000 quantity except for specials <S> So, go to eg <S> Digikey's website and key in microcontroller, select the largest volume option = <S> emebedded microcontrollers = <S> 33613 candidates, select sort by price <S> (arrow above unit price for Digikey), key in "in stock" and 1000 quantity and select "Sort by price, advanced". <S> Bingo. <S> PIC10F200T <S> -I/OTCT-ND <S> 34 cents US from 100 up! <S> As a check, take the lower priced candidates and plug them into eg Findchips . <S> For the PIC10F200, 34 cents is as low as anyone advertsies on the open market via Findchips. <S> You can bypass the front end with desired using eg <S> http://www.findchips.com/avail?part=PIC10f200 <S> Higher volume: <S> If you want rather more than 1000 then people like Microchip have special untested supply lines where you are responsible for ensuring devices <S> are in spec and you get accordingly low prices. <S> These are sold in egh Asia to compete against the Asian direct PIC clones and against similar capability processors. <S> Prices down to around 20 cents should be "easy enough" to get. <S> As you get to high volumes pricing becomes subject to NDA. <S> I have seen prices of some products (not processors) which are around 25% of what may be reasonably expected at very high volumes. <S> (No I'm not subject to NDA but also am not going to be more specific, alas). <S> So, a 20c price in ongoing volume seems doable. <A> Current order of ultra low cost microcontrollers based on my knowledge (probably others, but I cant speak for what I dont know) <S> ST Microelectronics - STM8S003F3 - OTT spec for its price <S> ~$0.23 <S> ea <S> @ 25k <S> ~$0.30 ea @ 25k <S> Freescale MC9S08PA4 - good spec for its price - $0.30 ea @ 10k <S> NXP LPC1110FD20 (32-Bit Cortex M0) <S> good perforance for price - $0.45 @ <S> 10ku <S> NXP LPC811 (32-Bit Cortex M0+) basic peripherals - $0.40 @ <S> 10ku <S> Freescale MKL02Z08 16-pin <S> good peripherals - $0.49 @ <S> 10ku <S> NXP LPC1111FHN33 <S> (32-Bit Cortex M0+) <S> 33-pin <S> version - $0.60 @ <S> 10ku <S> TI MSP430G2333 <S> Ultra low Power, reasonable spec - $0.65 @ <S> 10ku <S> Your probably wondering why I haven't mentioned Microchip, or Atmel, and its simply because their sub-$0.60 microcontrollers have extremely small Flash & RAM, and very limited peripherals as well as limited number of GPIO usually in an 6-pin to 14-pin package. <A> Atmel ATtiny13 . <S> Short datasheet here . <A> All uC vendors have chips under 1$. <S> It's more about what you can buy in your local shops in small quantity. <S> For example, I was paying for Attiny13 ~1.5$ <S> which is much more it costs at the manufacturer. <S> And I don't have msp430 for any money here. <S> So, check your shops, that's the only way to go. <A> The price of anything is dependent on what you can negotiate. <S> If you are only looking at hobbyist quantities, I'd ask why it matters, since the price difference between 10 cheap MCUs can be a penny or two <S> and you'd spend more time selecting a chip than your time would be worth. <S> If you're buying large production quantities, then the price you pay will depend on your relationship with the vendor, how many they think you will order in the future, what else you're bundling with your order, what particular chip that vendor has overstock of and wants to dump, how much they paid for that stock, how much it costs them to keep carrying the excess inventory, etc... <S> There really is no simple answer.
ST Microelectronics - STM8L051F3 - OTT spec for its price Cheapest part is the ATtiny4. (32-Bit Cortex M0+)
Basic Training for working with 120V AC I'm planning to build a digitally-controlled light dimmer circuit. I'm not trained in electrical engineering, and I don't want to do something that an electrician would immediately recognize as dangerous and stupid. Please suggest a reasonable home set up for prototyping circuits involving 120V AC power. <Q> As far as lab equipment goes, a 1:1 safety transformer <S> (AC mains : AC mains) is worth a lot. <S> They aren't cheap, but I would not want to work without one. <S> Mine is home-built and uses two 250 W transformers back-to-back. <S> The trick of the 1:1 transformer is this: Current from its secondary winding can only go back to the other end of this exact winding. <S> As long as you touch any circuit connected to the 1:1 transformer with one hand only, you are safe because the current from your finger can not go anywhere. <S> You are a bit like a bird on a wire. <S> A regular wall outlet is referenced to earth, just like you are when standing on the floor: In a fault, current from the live pin of the outlet runs through you, the floor and to earth, which is equal to the other end (neutral) of the wall outlet. <S> Keep in mind that current always needs a loop to flow in: <S> Any energy that comes from the transformer can go back to this transformer only, and can not go anywhere else, especially not to the ground via your body. <A> You don't have to probe a live circuit. <S> Get test leads with insulated clips on them. <S> Clip onto the circuit with power off. <S> Turn it on, stand back, and look at the reading. <S> Never use an oscilloscope on a non-isolated circuit. <S> I would also suggest some kind of pilot light in the circuit <S> so you know when the power is on. <S> (Just unplugging is not enough if you have large capacitors that store high voltage, but I don't think you will for a light dimmer.) <A> If you're not comfortable with it, don't do it. <S> If you must, use the one hand rule, and keep one hand in your pocket while working with live AC. <S> Also use insulated tools. <A> Apart from what @bt2 said Don't be alone, so someone can call 911. <S> Show them where the off switch is. <S> Don't wear a ring, watch, necklace. <A> Since it would be impossible to turn you into an electrician in a single answer, I'll recommend some reading. <S> For the US, home wiring is governed by the NEC (National Electrical Code). <S> It's a huge, detailed, expensive publication. <S> For a DIYer, I strongly recommend purchasing the most recent edition of Wiring Simplified . <S> It's probably available at your local (or big-box) hardware stores <S> (I've seen it at Ace Hardware and Home Depot), or here on Amazon , should be around $10. <S> I use it when planning any electrical job at my house, parents' cottage, or workshop. <S> From the Amazon description: Revised and completely updated for the 2008 National Electric Code, this small manual continues its 75-year history of demonstrating how to install safe, convenient, and economical wiring. <S> Encouraging readers to tackle jobs small and large, the guide covers everything from repairing a table lamp to wiring a whole house. <S> After introducing the basics—standards, codes, safety practices, and an overview of how electricity is measured and delivered—chapters show how to design a layout for lights, switches, and receptacles; run a line from a utility pole; install wires, circuits, and grounds; and handle special projects such as replacing old wiring and wiring detached garages and accessory buildings. <S> There is a section on safety, and the book recommends good practices, but it's not a replacement for training. <S> It's a good reference for knowing what you're working with, though, and common-sense rules (like the one-hand rule, disconnecting the breaker, and wearing rubber-soled shoes) together with this book will make you a much better electrician. <A> The inimitable Dan of Dan's Data has an entertaining article on avoiding electrocution . <S> The follow up <S> mail on the subject contains further tidbits . <A> Also buy the metal junction box to install the switch in and a faceplate. <S> Run your AC input into one side of the switch, and the other side to whatever circuit you're playing with. <S> This is a good way to be able to see at a glance whether power's on, and to have an easy cut off. <S> At work, I have this installed on a wooden board with the output wires going to a pair of terminal blocks. <S> This makes it easier to change what's connected. <S> Whatever you do, make it perfectly clear which switch position is 'on' and <S> which is 'off' for safety.
I wouldn't mess with AC unless you're totally confident in what your doing. I recommend going to your local hardware store and buying a light switch with a neon tube in the switch.
PCB copper thickness with small pitch SMT components I typically use 2 ounce copper as rule for all my PCBs. On a recent board I am using a 0.5mm pitch, relatively large micro, and noticed the pads aren't very flat. Assembly went fine with the protos, but I'm wondering if 1 once copper would provide for a flatter landing service. Does anyone have any experience with using 1 and 2 ounce copper with small pitch devices and/or any advice on assembly reliability related to copper thickness for such devices? <Q> Unless you need high-current capability, 1 oz is the default thisckness. <S> Line definition can be impaired with increased thickness, so only use when necessary. <A> 1 oz (35 um) copper is much more suitable for SMD. <S> Most board suppliers provide it as standard. <A> You don't seem to have a good reason to use the 2 oz copper ( "I wish I had a good answer but basically because that's how we've always done it." ) <S> The main reason to use it is for high currents. <S> If you don't have that, use 1 oz <S> , it's the standard thickness and should be a lot cheaper than 2 oz. <A> I summarize PCB fab capabilities at the PCB manufacturers page.(You can help -- it's a wiki). <S> Capabilities are different for every PCB fab, but they often publish "preferred" capabilities that look something like 0.30 mm track/gap on 2 oz boards 0.15 mm track/gap on 1 oz boards 0.10 mm track/gap on 1/2 ounce copper boards and "minimum" capabilities that are a bit tighter. <S> Thicker copper makes it more difficult to properly fabricate footprints for fine-pitch SMT components. <S> If you do need lots of copper to provide a good heatsink or to handle high currents,then a single PCB with 2 oz copper will likely to minimize your net costs. <S> However, I've seen a few cases where designers were able to save a few dollars by re-designing the system to use 2 PCBs -- one small PCB with thin copper and narrow traces and multiple layers to support the fine-pitch SMT components, plugged into another PCB with one or two layers of thick copper and wide traces to handle high-current stuff. <A> If higher current handling is needed only in specific traces, I've often seen the use of a tin reinforcement on the copper. <S> It seems to be quite effective, as explained here .
If you don't need lots of copper to provide a good heatsink or to handle high currents,you might be able to save a few dollars by using exactly the same board layout and specifying 1 oz or 1/2 oz copper instead of 2 oz copper -- especially if it results in the board being able to use one of their standard "preferred" processes rather than one of their more expensive "minimum" processes.
How to measure temperature using a NTC thermistor? I have a TTC103 NTC thermistor. It has zero-power resistance of 10 kΩ at 25°C and B25/50 value of 4050. How do I use it to measure temperature? <Q> Use it as one leg (say the "upper" leg) in a voltage divider circuit with the other leg being a known resistance. <S> Measure the voltage at the midpoint of the divider (e.g. with an analog-to-digital converter). <S> Infer the thermistor resistance from the measured voltage as: \$R_{thermistor} = <S> \left(\dfrac{V_{cc} }{V_{measured}} - 1\right) \times R_{known}\$ <S> Use the equation: \$T = \dfrac{B}{ln \left(\dfrac{R_{thermistor} } <S> {R_0 \times e^\frac{\large -B}{\large <S> T_0}}\right)}\$ <S> in your case <S> , \$R_0 = 10000\$, <S> \$B = 4050\$, and \$T_0 = <S> (273 + 25) = <S> 298\$. Plug those numbers, plus the measured resistance of the thermistor into the equation and out pops a temperature in Kelvin. <S> Read <S> this wikipedia article for more details. <A> NTC (negative temperature coefficient) thermistors change their effective resistance over temperature. <S> The most common equation used to model this change is the Steinhart-Hart equation . <S> It uses three coefficients to characterize the NTC material with great accuracy. <S> The Steinhart–Hart equation is a model of the resistance of a semiconductor at different temperatures. <S> The equation is: $${1 \over T} = <S> A + B \ln(R) <S> + C (\ln(R))^3$$ where: \$T\$ is the temperature (in kelvins) <S> \$R\$ is the resistance at \$T\$ (in ohms) <S> \$A\$ , \$B\$ , and \$C\$ are the Steinhart–Hart coefficients which vary depending on the type and model of thermistor and the temperature range of interest. <S> (The most general form of the applied equation contains a \$(\ln(R))^2\$ term, but this is frequently neglected because it is typically much smaller than the other coefficients, and is therefore not shown above.) <S> — <S> Steinhart-Hart equation - Wikipedia, The Free Encyclopedia <S> Many manufacturers provide application notes (e.g. here ) detailing on how to calibrate a given NTC if you desire accuracy better than the quoted manufacturing tolerance. <S> The provided B-coefficient can be used in a simplified Steinhart-Hart equation as described on the Wikipedia Thermistor article under "B parameter equation" . <A> NTCs are non-linear and you'll see rather nasty formulas expressing the relationship temperature-resistance. <S> Adding a pair of ordinary resistors you can linearize their behavior so that this relationship is approximated by a simple linear equation of the form \$y= <S> ax+b\$. <S> The following example is from this Epcos appnote . <S> The curve is virtually straight from 0°C to 60°C, which is sufficient for many applications. <S> In this answer <S> I show how in some cases you can get an almost perfect (15 ppm) <S> linear curve over a limited domain with just a series resistor. <S> edit <S> If you don't have the money for a resistor you'll either have to use the Steinhart-Hart equation Nick and Vicatcu <S> refer to, or use a lookup table and interpolation. <S> Both have the disadvantage that they need more memory: <S> Steinhart-Hart contains a logarithm, for which you'll need a floating-point library (I assume your microcontroller doesn't have a floating-point ALU). <S> The lookup table needs some memory as well, and may not give you a better precision than the linearized function if you have to interpolate that. <A> An NTC has a non-linear response to temperature. <S> Then, you can get a resistance \$R\$ from this using Ohm's law. <S> For example, say you have a 5V supply use a 1k resistor in series with the NTC <S> and if you measure 0.5V, just divide 1k by 0.5V and get 10k ohms as the resistance. <S> You also need, \$T_0\$ and \$R_o\$, a 'fixed' temperature in kelvins and at that temperature, its resistance. <S> It's usually given at room temperature. <S> Then, given these details, put it into this equation to get T , the temperature. <S> \$T=\dfrac{1}{\dfrac{1}{T_o} + (\dfrac{1}{B <S> } * \ln\dfrac{R}{R_o}) }\$ <A> There are a number of ways (both in terms of analog circuits and in terms of software computation) to use thermistors to measure temperature. <S> The short answer, is roughly as follows: <S> Use the thermistor and a reference resistor to make a voltage divider. <S> Take the middle of the voltage divider and feed it into an analog-to-digital converter. <S> Measure the ADC voltage in software. <S> Using your knowledge of the reference resistance, and the thermistor's R vs. T curve, convert from ADC counts to temperature. <S> There are a number of subtleties here, so for further reading you may want to check out this article of mine on thermistor signal conditioning -- hope this helps!
You can work out the resistance of a thermistor by measuring the voltage across it in a potential divider circuit.
Resistor-only solution to split 19V 3A to 3.3/5V and 12V 2A with common ground? I need to quickly assemble a simple thing, a LED strip driver with ATTiny/Atmega. My powersource is (as always) a universal laptop brick (17-21V output @ up to 4A). So AVR would be hooked into a number of ULN2003 to control overall drain (near 2A, 12V). The problem is, it would take few days to deliver me anything better than a couple of resistors (have a lot of those here), so can make only a common-ground resistor divider. Problems: How to calculate the resistors to power both parts correctly? (even worse) how to limit the current for ICs to about 500mA? Only resistors, remember. Maybe a bit of transistors/capacitors, but (almost? ideas?) nothing smarter. . <Q> This is a bad idea! <S> In order to use a resistor divider, you need to have a good feel for how much current your devices use. <S> Also, while you may have a lot of resistors, you will need high power resistors. <S> Resistor-divider power supplies are <S> EXTREMELY inefficient <S> For powering the microcontroller, we need to make sure that the voltage doesn't exceed the maximum rating, or else it will die. <S> For ATMega parts that tolerate 5V, the maximum input voltage is 5.5V (5V +10%). <S> Lets suppose that the current through R1 and R2 is 10mA. R1 will drop (Vin-Vreg) volts, and then using Ohm's law we can find the resistance of R1: (21V - 5.5V)/(10mA) <S> = 1.55 kOhm . <S> R2 will drop the voltage Vreg, so once again Ohm's law shows us (5.5V)/(10mA) = <S> 550 Ohm . <S> How much current can this supply source before we start having funky issues? <S> This is hard to tell for me because the AVR has such a range of operational voltages (5.5V to 2.7V). <S> If we say that we shouldn't fall below 4.0V, then the maximum load current is equal to: (Vin - Vreg_min)/(R1) - (Vreg_min/R2) or (21V - 4V)/(1.55kOhm) - (4V/550Ohm) = <S> 3.7 mA . <S> R1 will dissipate the most power, and if you're using 1/4W resistors, you need to be careful here. <S> The power dissipation of R1 will be most when the load is drawing the maximum current: P = <S> (Itot)^2*R1 = <S> 10.97mA^2 <S> * 1.55kOhm = 187mW . <S> Increasing Iquiescent (decreasing R1 and R2) will increase your maximum current, at a major cost to power. <S> Increasing the operating range will decrease the power, but may cause issues. <S> If you can identify the current for each leg that you are switching, you may be able to just add a series resistor with the light bar. <S> For example, if one of the legs normally draws 100mA at 12V, then you could add a series resistor (Vin - 12V) / <S> (Iload) <S> = <S> 90 Ohms and things should just work out without providing a constant 12V. Note: Use as low of a voltage on your power supply as possible. <S> I'm not sure if this is adjustable, but if it is, use 17V instead of 21V. <A> You can only use resistor dividers as a voltage source if you know the resistance of your load and it is constant. <S> If you are switching LEDs on and off, for example, the load is changing and so will your voltage. <S> But even if you had a constant load, trying to get 2A from a resistor divider seems crazy. <S> If you have transistors, perhaps you could rig together some simple transistor regulators. <S> These usually require zeners, but do you have diodes??? <S> You could put a bunch in series to the get the required voltage drop to set the base voltage. <S> Still... your transistor will be getting HOT at 2A and a 7V drop. <A> Resistor only? <S> Very bad idea. <S> A basic NPN emitter follower should work for a positive regulator, giving a voltage roughly equal to V B (the resistor divider) <S> - V BE(sat) <S> (characteristic of the transistor, usually 0.5 - 1 V) <S> Using a resistor divider as your voltage reference means it's obviously just a ratio of the input voltage, so ideally you'd use a Zener as a reference. <S> If you don't want to use Zeners, you could chain normal diodes. <S> If you don't want to use diodes, you can use transistors like diodes. <S> If you want to avoid that, you might be able to (severely abuse) <S> the leakage current of capacitors (especially electrolytics) near their rating to provide a voltage reference.
If you're open to using transistors though, as you mention, you could use one with a resistor divider as a crude linear regulator. You'd need very large power resistors.
PICs for beginners using MPLAB Compatible Mini USB PIC Programmer I wrote a program to turn on LEDs on PORTB. The programmer erased, programmed, verified, so far so good. But then nothing happened. No lights. My programmer is a MPLAB Compatible Mini USB PIC Programmer. What are some things that novices miss? Below is my code: #include <p18f4550.h> #pragma config WDT = OFF void delay (void) { unsigned int i; for (i = 0; i < 65535 ; i++) ; } void main (void) { TRISB = 0; while (1) { PORTB = 0; delay (); PORTB = 0xFF; delay (); } } <Q> Did you forget to set the LED pins to output? <S> Each pin you want to drive a LED <S> must be set as an output in your code. <S> This involves setting the TRIS bits for that pin to '0'. <S> Did you connect the LED backwards? <S> LEDs will turn on only when the anode-cathode voltage is positive. <S> Do you have a clock source? <S> Without a clock, your program won't run. <S> Do you have the LED connected to the correct pin? <S> Is power applied to the circuit? <S> Do you have bypass capacitors for the PIC? <S> Is there a resistor pull-up for MCLR? <S> Without this pull-up, your chip will stay in reset and never execute your program. <S> Check your wiring again. <S> Wiring and connection errors are very common in beginner's circuits. <A> Most common is using pins that are shared with the ADC. <S> You need to enable them for digital <S> I/ <S> O as they are analogue inputs by default. <S> Quote from PIC18F2455/2550/4455/4550 datasheet : <S> Note: <S> On a Power-on Reset, RB4:RB0 are configured as analog inputs by default and read as ‘0’; RB7:RB5 are configured as digital inputs. <S> By programming the Configuration bit, PBADEN (CONFIG3H<1>), RB4:RB0 will alternatively be configured as digital inputs on POR. <S> That is probably the cause of the problem. <S> Some of the PortB pins of the PIC18F4550 are shared with the ADC. <A> "What are some things that novices miss?" <S> First check your hardware. <S> Find <S> a blink-a-led.hex file that is known to work and verify that your hardware works. <S> (I have some on my website, Google is your friend) <S> You have disabled the watchdog, that is a good start, but there are some more fuses settings that are need, especially the oscillator (XP, HS, internal, etc). <S> Set the pin direction (TRIS <S> , you did so) <S> Avoid the Read-Modify-Write (RMW) curse (write the whole PORT or use shadow or use LATx) <A> All of these answers have valid potential issues, especially Leon's point that analog pins can be tricky and W5VR's point about MCLR not being pulled high. <S> Also - depending on your chip, you may need to write to the LATB register for output and read from the PORTB register for input. <S> Docs on the difference between LATB and PORTB are iffy and in the pst I've had to use some trial and error to make it work. <S> LATB is the port B output latch. <S> This will contain the most recent values that you wrote into the latch. <S> Under some conditions (say, your output pin is heavily loaded) <S> the actual value on that pin may drop quite low. <S> This can cause an erroneous reading of PORTB, i.e. it will return 0 when it should return 1. <S> Thus, it's safer to read LATB because this will still contain the 'correct' value. <S> @kellenjb: You should be able to run the program without removing the ICSP cable, IF you use Debug mode in MPLAB. <S> Otherwise, if you build the project as Release, you will have to pull the cable out. <S> Debug mode may not be supported for OP's programmer; it works on my Pickit2.
Make sure you're using a clock source that's hooked up, or the internal RC oscillator. Configure the relevant pins as digital pins (check the A/D and comparator modules)
Looking for an inexpensive Smoke Detection Sensor As the title says, I am looking for a smoke detection sensor. Took a look from SparkFun to Mouser and did not find anything. Is there a part you would recommend? I would prefer something that interfaces with the ATMEGA168/ATMEGA328 via a single wire or two wire interface. Would prefer to avoid a SPI or Serial interface as my circuit already utilizes those pins. Bumped into a few sensors on Ebay but they were $15+. Is this normal? Is there a cheaper alternative that works great? Should I just buy a cheap smoke alarm and extract the sensor that way? Thanks in advance for your help. <Q> I'd go for the cheap smoke alarm. <S> The actual sensor is a black plastic chamber with a LED and a photo sensor. <S> It is constructed so that with clean air no light reaches the sensor,it passes the center of the chamber and is absorbed on another side. <S> With smoke particles in the air some light is reflected towards the sensor and off goes the alarm. <S> As for the electronics, I opened up one such alarm and found an MC145010 . <A> Well, if you have some time to test, you can go for LED + Photodiode. <S> Should be <1 <S> $ :-) <S> The idea is that LED should not shine directly on photodiode, air should be able to fly around, but not light. <S> In ultrapure air photodiode should see 0, the more smoke in the air - the more diffused light will get to diode, and you'll be able to measure it via ADC. <S> But this definitely require some testing. <S> /visible one, as there is less UV light noise (except xenon flashlights from cameras, be sure to test & filter for it). <S> This surely require some experimenting. <S> As a side note, I love to see air quality in beam of 100mw green lazer, but this is definitely not cost effective :-D <A> The MQ-2 Flammable Gas/Smoke sensor might be what you are looking for. <S> Datasheet: http://www.pololu.com/file/download/MQ2.pdf?file_id=0J309 <S> Here is one source: <S> http://www.pololu.com/catalog/product/1480 <S> They also have a carrier board to make it easy to interface. <S> It does not provide a digital interface, but provides an analog voltage that could easily be read by the ATMEGA168/ATMEGA328 <A> <A> Microchip make the required ICs. <S> For photo detection <S> For ionisation detection
Personally I would go for UV diode, not IR If you're looking for the optical type, it looks like one can use an analog infrared photodiode/sensor and emitter module along with a controller, like this one .
How to estimate the cost for creating a device for test purposes I have an idea of an electronic device, some kind of a gadget. It will have a bluetooth chip, some memory in it, some led indicators and some controlling chips, not sure yet how it should be constructed. What I need now is to estimate an approximate cost of the gadget hardware itself including the board, chips and the plastic case. What is a good way to calculate the cost? <Q> A ballpark figure for the manufacturing cost can be obtained by multiplying the parts cost by 3 to 5. <A> Here is what I use for estimates, they are not accurate by any means be at least gives me an idea: $0.50 per part to be soldered $300-$400 for a PCB order under a quantity of 100. <S> Divide by the number of boards you want to get the cost per board If you already know what parts you are using, add up their cost Add on an extra buffer to account for all of the stuff you haven't thought of <A> Parts cost is all about volumes. <S> If you're making a handful, go with the prices on Farnell/Digikey/Mouser/etc. <S> and buy from there. <S> If you're making in even modest quantities, you need to get on the phone with suppliers and request quotes. <S> As others have said, accurately predicting manufacturing costs is also hard. <A> Estimating project cost is an art. <S> It can be guesstimated by kludging together development time, parts and manufacturing cost. <S> Only you know how much your time is worth <S> -- I go by 5CAD/hr-15CAD/hr for personal projects, 25CAD/hr-50CAD/hr for contract work (experienced EE's use 100-200/hr). <S> As Leon mentioned , multiply parts cost by ~3X for manufacturing, including enclosure.
Time really is money, so the first thing to do is break down how long each part of the development cycle is going to take, then multiply by 3X.
Sizing an RC snubber My fridge is sending bad clacks to my loudspeakers when it turns on/off, I fear for the tweeters. I'd add a snubber/suppressor to the compressor but my notions about RC filters from school are 15 years old and I have no idea how to dimension it. It's an old european fridge, so mains are 220V 50Hz, and the compressor mentions two other values In=0.8 and Icc=6.3, which I suppose are nominal and startup current. Do I need to compute the motor inductance? What condensator/resistor values to pick? Is an RC snubber even the correct fix? How to estimate the RC values for snubbing an A/C motor? Trying another approach. I've found a some usual R/C values for suppressors. For instance this one is 47ohm / 0.1µF, giving 33kHz of cutoff frequency... but the datasheet says up to 62Hz? Why is there 3 orders of magnitude difference ? EDIT: in the end I added a capacitor to the fridge and that resolved the problems. That was quite long ago so I don't remember the exact value, but if anyone wants it just bump me… <Q> You may want to consider using an NTC inrush limiter in series with the compressor instead of a snubber. <S> Make sure you choose one <S> well-sized for the steady-state current of the appliance. <S> A safety-recognized X-capacitor across the mains may also help suppress noise. <S> There are also off-the-shelf EMI filters that could help with the noise if you prefer a pre-fab solution. <S> I would guess that the motors in a washing machine wouldn't be so different from those in a fridge from an EMI standpoint. <A> Your fridge may have poor grounding. <S> I've run into more than a few old ones that had a floating ground that intermittently 'closed' to Earth, one of which gave me my first close encounter with mains power (and later used to shock people at parties, but that is another tale). <S> Measure the compressor chassis voltage versus mains Earth/ground (or see if there's only 2 prongs in the plug). <S> Of course ya can't just short the chassis to ground straight away if this is the issue -- see if there's a constant current path, first. <S> I'm not sure why there would be, but it's possible! <S> If there is, I'd look into it some more: why is the chassis energized? <S> Is some insulation worn through? <S> Oh yeah - don't get killed or anything. <S> The other way to go about this is to protect the speakers directly. <S> This can be done with clamping diodes or other TVS parts . <A> The fridge may be dumping noise on your power line, but the real problem is the amplifier driving your speakers. <S> Either the amp itself has bad line filtering, or your setup allows noise to get into its audio inputs. <S> Disconnect the audio input from the amp and see if the fridge can still cause clicks in the speakers. <S> If so, then the amp has a crappy power supply circuit and needs help in the form of a line filter. <S> If the noise goes away when the input to the amp has been disconnected, then the noise is already on the audio signal by the time it gets to the amp. <S> There are two likely causes to this, bad shielding and bad grounding. <S> If you are using regular off the shelf shielded audio cable and it is properly connected at each end, then shielding is probably not the cause. <S> The most likely cause is then a ground loop. <S> Is the amp plugged into the same outlet as whatever equipment is producing the line level audio signals going into it? <S> If not, then you have a ground loop. <S> The fridge is probably causing a significant ground bounce when it turns on and off, and this is getting into your audio signal due to the different ground points. <S> Plug all the audio equipment into the same outlet strip plugged into a single outlet in the house. <S> Adding a line filter to that wouldn't be a bad idea. <S> You can try to reduce the noise the fridge is making, but that's just one noise source of many that the audio system needs to be immune to anyway. <S> Crap on the power line happens, regularly. <S> The audio system should be set up to deal with it properly.
You may also wish to try putting an appropriately-sized metal-oxide varistor across the mains to clamp any badness generated by the compressor.
Why do chips not always "meet the grade"? During manufacture, integrated circuits are tested at varying frequencies and temperatures to categorise them into speed grades. However, why don't all ICs come out the same and work the same? They all come from the same photolithographic mask, right? Am I missing something? <Q> Modern ICs are REALLY small. <S> Tolerances are huge during processes such as ion implantation and oxide growth. <S> At such small sizes, these things can't be treated as anything but a probabilistic process. <S> Lines also tend to be smeared due to the feature size being the minimum possible given the wavelength of light. <S> When you get worst-case performance in a bunch of these different steps, then you get a non-functioning IC. <S> Companies don't design the IC so that it functions at the worst-case - it would be too costly. <S> So instead they do Monte Carlo simulation of the manufacturing parameters, estimate a yield, and do testing after the fact. <S> Typical "design corners": <S> Source: <S> What I remember from my IC manufacturing class. <A> There isn't really a "worst case" - manufacturing IC's is a statistical process, there will be some (small) percentage of transistors that are a very long way from typical speed (imagine a statistical distribution curve drawn here). <S> The distribution of speeds for the two types of transistors in CMOS (NMOS and PMOS) don't correlate well. <S> Thus, they pick those 4 corners: <S> Fast/Fast, Slow/Slow, Fast/Slow, Slow/Fast out of their two transistor speed yield curves. <S> The further out from typical they choose to make the corners, the higher their yield, but the more difficult it is to design. <S> If the corners are too far apart, design for operation at the 4 corners takes too much development time and can increase the die size. <S> Increasing the die size will decrease yield. <S> The four corners often form more of a parallelogram than a rectangle. <S> If both types of transistors, across one whole die, are all very fast, the part will probably work, maybe well beyond the rated speed, and same for both transistors getting slower - the part will work, but at a very slow speed. <S> The difficult corners are the fast/slow and slow/fast. <S> The design is indeed fully simulated at typical/typical, and the four corners. <S> Monte Carlo simulation is used to check some of the intermediate combinations. <S> To increase yield, they can sort the die into bins after manufacture and thus sell the slow/slow parts that would otherwise be thrown away, and sell the fast/fast parts for a premium. <S> And yes, some manufacturers will use fuses to restrict a part to a certain speed grade. <S> Because manufacturing yield curves and market demand being uncorrelated functions, sometimes they have to down-grade parts. <A> Mostly what krapht said. <S> You'll end up with some that either can't work, or can only work at say a slower clock rate. <S> Also you might see some computers offered with say a three-core chip. <S> Such a chip is probably a four-core chip, but a faulty core has been disconneted in postprocessing, and the chip sold as a cheep 3banger. <S> I would add, nothing wrong with that, if that's the capability you need, then the manufacturers bad luck is our gain. <A> IC chips are just shrinked to the point where they "barely" work. <S> You can make chips on 3um process with nearly 100% good rate and very little variation, but it's just too expensive (and slow). <A> For analog functionality, sometimes the chip can be intentionally hobbled and the same die sold cheaper with not-so-good performance. <S> Blowing on-chip fuses to reduce bias currents (for example) can reduce the overall performance of the chip. <S> For digital chips that are required to run at speeds approaching the capabilities of the manufacturing process, final test will weed out the best performers from the not-so-good performers and 'bin' them accordingly. <S> Differences in speeds are usually caused by statistical variations in the manufacturing process.
I'd add that parts are getting so small that even without variation in geometry, the number of doping atoms per transistor are also becoming small, so simple statitical variation means some will be faster and some lower, and the gain also varies.
Combine a low power XBee receiver with high power XBee transmitter in a model rocket Have got some existing low power 2mW XBee series 2 with an Explorer that I've used successfully to communicate between a PC with the XBee Explorer and a remote Arduino based project. I'd now like to create a one way link to send telemetry data from a model rocket with an Arduino based telemetry board that has a ZigBee option. I'm thinking I'd be able to get away with the existing low power XBee I have plugged into the XBee explorer as the base station to receive the data and just purchase a high power XBee with an aerial to mount inside the rocket. Does anyone have any experience or comments about combining a low and high power XBee to create this one way link from the rocket to a base ground station? I realise the XBee must be of the same series (1 or 2/2.5) to be able to successfully communicate. The ones I currently have are these www.sparkfun.com/products/8691 and I'm thinking if I bought something like this http://www.littlebirdelectronics.com/products/XBee-Pro-50mW-Series-2.5-RPSMA.html# I'd be able to create a reasonably good distance link for a smallish model rocket to send it's telemetry data through. One issue I'm seeing is that the transmitter may need to be in some sort of broadcast or no sync/acknowledge mode as the receiver would be low power and not be able to transmit data/acknowledgements back to the rocket to acknowledge data being received. It also may (given a very good flight) go out of range and so coping with nobody listening/receiving needs to be configured into the transmitter end. Second, what aerial or version of the 50mw XBee would make sense to use in the rocket? The link to the one I've shown above requires an external RSPMA aerial to be plugged in. Assuming the combination of high to low power sending only would work, would this be the right aerial type to use being mounted internally in a rocket? Or am I just trying to make this all to complicated and should ignore the fact that I have low power XBee modules now and buy 2 high power ones that I won't be transmitting from one with? Thanks. <Q> I guess you are not trying to get range >1km, right? <S> Are you really sure you need telemetry? <S> Logging data into microSD card is way easier & more reliable. <S> microsd card can survive even the most horrible crash. <S> If you really need to extend range, I would suggest directional antenna on ground receiver with servos to track rocket. <S> That would be very fun and will extend the range much more than 50mW transmitter. <A> It's been a couple years since I worked with ZigBee, but I think that most commands require ACK sequences. <S> This is the case for most (if not all) popular RF networking protocols. <S> It should be possible to implement your own protocol. <S> This could be as simple as an uninterrupted stream of data if you're just logging it to a PC or laptop. <S> You would get much higher data rates with such a system when comparing to ZigBee. <S> A line encoding that gives you DC balance would help, as would clock synchronization, bounded disparity, and/or error correction. <S> But, if it's not a big deal to loose a few data points every once in a while, you should be able to develop a simple protocol that wouldn't require replies. <S> Edits: <S> Reading the datasheet confirms that ZigBee requires acknowledge packets. <S> It even says that "It is possible in rare circumstances for the destination to receive a data packet, but for the sourceto not receive the network acknowledgment. <S> In this case, the source will retransmit the data...." <S> - This is exactly what you don't want. <S> Transparent mode appears to be a system by which the XBee does the ZigBee configuration automatically-not a low-level version of the API. <S> You'll want to check this. <S> The last RF job I did used the Microchip MRF24J40 , which took the opposite approach: The whole communication stack was on the host processor. <S> To understand why the communication will be unidirectional, you should know that the 2mW and 50mW specs refer to the transmit power only. <S> The receiver sensitivity is almost the same for both at about -100dBm: The high-power version is actually a little bit less sensitive on the receiving end than the low power version, probably due to parasitics of the active antenna circuit. <S> Since they're both operating on the same frequency, they should be perfectly able to communicate <S> - There's no way of knowing whether an incoming signal is a low-power transmitter close by or a high-power transmitter far away. <A> The S1 modules allow use of 'broadcast mode' where ACKs are not sent. <S> Using an S1 module in broadcast mode will work correctly with a low power module in the base station, presuming there is no need for the base station to transmit to the rocket. <S> I do not believe this is possible with <S> the S2 units - S1 is good for point-to-point, S2 is good for mesh.
It looks like you'll need custom firmware for your XBee to work with a custom protocol.
Can an XBee be programmed with an XBee Shield I have an XBee and an XBee Arduino shield. Can I program my XBee through my Arduino Twenty-Ten and an XBee shield? Can I do anything with just one XBee? <Q> Recommend you get yourself one of these . <S> It's well worth the price and will save you a lot of headaches. <S> Programming can get complex, if you're doing it manually instead of using X-CTU . <S> Since you really only have to do it once, it's much easier to tweak the settings in X-CTU and not bother with the programming code within your application. <S> When you've learned all you can, you'll have to buy another one. <S> :) <A> The XBee is a ZigBee module with a serial interface. <S> It is designed to act as a radio communication peripheral for a microcontroller or PC. <S> The program code inside of the module cannot (without specialised tools) be modified, instead, you're limited to the commands listed in the user guide . <S> The XBee can be controlled either via your Arduino or with a PC and serial port. <S> A single unit is not very useful, unless you have access to other ZigBee devices . <A> What I did is to put your Wireless shield in USB mode and then plug the Arduino Reset on the GND like that : <S> Then you can configure your XBEE with picocom or X-CTU Edit <S> Much more simpler, just upload this to the arduino board : <S> void setup() {}void loop() {} Then set your Wireless switch on USB <S> and that's it !
About the only thing you can really do with a single XBee is learn about it: fiddle with the settings and whatnot.
Is my butane soldering iron's tip dead? (pic) I've read the other posts on iron cleaning technique and I'm pretty sure I left it dirty often enough that it's toast , it seems the iron coating on the tip has flaked off completely; since I've got nothing to lose I'll attack it with a file in a second and see if I can get another small job out of it. $15 lesson learned. The real question is why the plating up near the catalyst is flaking off and the whole tip is bending. Does this indicate I'm using too much heat? <Q> NEVER USE A FILE!!! <S> If you use a file on a (long life) <S> soldering iron tip <S> you will ruin it! <S> You are running the iron much too hot, turn it all the way down <S> so the catalyst is only just glowing, if that's too cold turn it up slowly!!! <S> To get your tip back use tip tinner or a soft wire brush, such as brass to avoid damaging the tip. <S> Again, NEVER, EVER get a file anywhere near a non-shitty soldering iron. <A> I've rescued many tips this way. <S> Image from http://store.curiousinventor.com/guides/how_to_solder/cleantip/ <A> It's just a good excuse to switch to a soldering iron with replaceable tips (butane or more conventional) ;-) <A> That looks like a tip from a Radio Shack butane soldering iron. <S> I have one just like that <S> and it does tend to run VERY hot! <S> Even with the adjustment at the lowest setting. <S> The tip seems to have a fluffy fiberglass like substance in it which acts like a catalyst. <S> But because the soldering iron runs so hot it tends to burn out the catalyst until there's nothing left. <S> I've found that you can replace the burned out catalyst material with a very (very) small amount of fluffed up fiberglass insulation material. <S> After replacing the catalyst you will need to let the tip flame for a few minutes before it starts to glow. <S> But keep the heat turned down or you will burn out the fiberglass again.
A good dip and rummage in a tip tinner will help your tip.
Obtaining 15 V from a single lithium polymer cell I want to get 15V output from a 1 cell lithium polymer battery which has a voltage range of 3v-4v. I am thinking about using a 34063 to accomplish this. But will this work over a 1v range or do I need a different ic? edit:I want to get around 250mA <Q> The 1V range from 3-4V isn't the problem. <S> It's the minimum voltage requirements are worrying. <S> Your desired operation from a single coin cell is really a special application, and, as Madmanguruman said, it looks like this IC was made for much less imaginative applications - boosting a 5V supply. <S> Since your users might be tempted to stick in an alkaline battery or a dead battery, why not use something that's designed to work with a lower voltages? <S> Linear Technology's LT1308 switcher will work down to 1V, and has a switch current of up to 3A, so you should be able to get 15V at 250mA out of it. <S> (Disclaimer: I like Linear products; I go to their site first to look up stuff like this. <S> I didn't compare with other manufacturers, but you should.) <A> A big concern is that the datasheet you described characterizes many of the crucial parameters at VCC=5V. <S> You may find that getting the performance you want could be tricky, and part-to-part variations could play a big role. <S> You'll need to prototype the circuit and test in the 3-4V range (and also most likely below 3V) to see what you're getting yourself into. <A> See figure 12. <S> Output current is not specified for input voltages under 5v, but if you need few hundreds milliamps it might be fine. <S> Anyway, using such a high-voltage chip for 3-4v power source is just a waste of silicon. <A> The easiest solution would be a PoL (Point of Load) converter such as TI's PTN04050C 12-W, 3.3/5-V Input, Wide Adjust Output Boost Converter . <S> However that is almost a 1 <S> A part and so overkill. <S> If I were cost- or area-sensative I might try TI's TPS61085 .
The IC regulates by comparing the output voltage with an internal reference voltage, so as long as the input stays within spec (some unpublished minimum voltage to a max of 50V) and below your desired Vout (this isn't a buck/boost converter), you should be fine. I would looks for another dc-dc, with higher switching speed & efficiency >80%.
Use a current monitor IC or roll my own? I'm looking to measure current consumption of my microcontroller as an in-built feature of the final design. Should I buy and use high-side current monitors that are available on the market (e.g. Zetex ZXCT1009 )? Or is it possible to build one out of discrete parts that's cheaper and better? Device operating out of a lithium polymer battery, so 3.7V typical only. Drawing around 0 to 30mA. <Q> There really isn't a reason to do so unless you have specialty application which requires something out of the norm. <S> Current monitoring for battery powered devices is a very normal application. <S> There are current monitors out there that output a PWM signal that you can monitor instead of a voltage that to be read with an ADC. <S> This type of monitor may be easier to interface with and require less power to monitor depending on the type of microcontroller your using and available peripherals. <S> You can also get regulators with built in current monitoring circuitry which can reduce part count, cost, board size, power usage and increase accuracy in some applications. <A> The working principle is simple, and it takes just three parts to do what the ZXCT1009 does: The opamp will try to keep the voltage drops across \$R_{SENSE}\$ and the 100\$\Omega\$ equal by controlling the current through the 100\$\Omega\$ resistor. <S> So if your \$R_{SENSE}\$ is 1\$\Omega\$ the collector current will be 1/100th of that, or 100\$\mu\$A if your microcontroller draws 10mA. <S> If you place a 10k\$\Omega\$ resistor between emitter and ground you get 1V/10mA out. <S> Yes, a resistor + a transistor + an opamp is cheaper than the Zetex device. <S> But you have to pay attention to the details. <S> \$V_{SENSE+}\$ will be your battery voltage, also your opamp's power supply. <S> At 5mA the input voltages will be 5mV below the power supply. <S> Obviously that calls for a Rail-to-Rail opamp. <S> But 5mV is very close, so you start digging in datasheets if the opamp can handle it. <S> (Don't bother, the datasheet doesn't say.) <S> Anyway, is it worth it? <S> Not to me. <S> The ZXCT1009 costs 1 dollar in 1's and is 1% accurate. <S> It might be different if I would need 100k/year of them, but for just one? <S> If you can't afford the dollar perhaps you've chosen the wrong hobby. <A> 1-wire is fairly easy and some micros can even talk to them natively. http://pdfserv.maxim-ic.com/en/ds/DS2438.pdf
You can build one with a simple op amp circuit, but it will take more design work, more external components and likely more board space. There are nice 1-wire devices like the DS2438 from Maxim-IC
Does anyone have code to emulate a 16-bit input shift register with an ATtiny2313? I would like to use an ATtiny2313 to emulate a Super Nintendo controller because I have an ATtiny2313 but I do not have an input shift register and I don't feel like soldering wires onto an existing SNES controller board. This application requires 12 inputs (bits 13-16 are always 1) and a latch, clock, and data out pin. Do you have this code lying around? It can't be more than 20 instructions. <Q> All you have to do is use it twice in a row. <A> I don't have this code lying around, but I do have the next best things: <S> AVR Instruction Set ATtiny2313 information <S> guide to starting in AVR assembler Macros in assembler <S> You might say I do have the code laying around, but it's not organized and concatenated correctly... ;) <A> As @tyblu says, it's all right there in the manual for the USI. <S> In particular what you want is to use it in "Three-Wire Master Mode Operation." <S> Take a look at Figure 61 on page 143 of the datasheet. <S> The datasheet is even kind enough to provide an optimized (8 instruction) assembler routine (SPITransfer) for this exact purpose: <S> SPITransfer: out <S> USIDR,r16 ldi r16,(1<<USIOIF) out USISR,r16 ldi r16,(1<<USIWM0)|(1<<USICS1)|(1<<USICLK)|(1<<USITC)SPITransfer_loop: out <S> USICR,r16 sbis USISR <S> ,USIOIF rjmp <S> SPITransfer_loop in r16,USIDR <S> ret <S> If you wire it up so that the you have a 2313 pin connected to the controller's "latch" wire (orange), the USCK pin connects to the controller's "pulse" wire (red), and the DI pin connects to the controller's "data" wire (yellow) <S> - you should be good to go. <S> Per the datasheet, the code example assumes that the DO and USCK pins are enabled as outputs in the DDRB Register. <S> Once the hardware is set up, all you need to do is generate a 12us high pulse on the "latch" pin, drop the pin low for 6us, then call the above assembly routine twice (saving the return value away) after each call. <S> I found this reference <S> very informative regarding the (S)NES interface. <A> The following code works great. <S> The latch signal is connected to PB5 . <S> The SIG_PIN_CHANGE handler does its work on both edges of the latch signal but it doesn't matter, and the last time I tried adding the check it did not work. <S> #include <S> <avr/io.h>#include <avr/interrupt.h>#include <avr/ <S> sleep.h <S> >ISR(SIG_PIN_CHANGE){ USIDR = <S> PINA | (PIND & 0b01111100) <S> | (PINB << 7); USISR = (1 << USIOIF); // clear overflow bit, set counter to 0 USICR |= <S> (1 << USIOIE) <S> ; // enable overflow interrupt}ISR(SIG_USI_OVERFLOW){ USIDR = <S> (PINB << 3) | 0x0f; <S> USISR |= ( <S> 1 << USIOIF); // clear overflow bit USICR &= <S> (0xff <S> ^ <S> (1 << USIOIE)); // disable overflow interrupt}int main() { USIDR = <S> 0xff; USICR <S> = (1 << USIWM0) <S> | <S> (1 << USICS1); <S> // 3-wire mode; external, positive edge. <S> DDRA = 0; <S> DDRD = 0; DDRB = <S> 1 <S> << 6 <S> ; // <S> MISO // <S> Enable pullups <S> PORTA = 0x3; PORTB = 0b11111; PORTD = 0xfc; // <S> USIDR is shifted out MSB first. <S> // <S> pin change interrupt for latch pin PCMSK = <S> (1 << 5); GIMSK |= (1 << PCIE); sei(); while (1) { sleep_mode(); }}
There's already an 8-bit shift register built into the Universal Serial Interface (USI) .
Switching a Kettle On/Off using a arduino First of I have no experience with electronics so I am not sure what I should be searching for to get this done. All I have with me at the moment is a arduino and a few connectors and LED's. Is it possible to switch the kettle on/off using just these basics (i.e. I dont want to buy more stuff for now). The kettle is the most basic kind , i.e. the ones that plug into a wall outlet and have a single switch to turn it on or off. Let me know if you need more info. <Q> There's a particular problem here with the kettle that a relay will not solve. <S> Kettles always have their own switch which trips off when they boil. <S> So even if your relay is on, the kettle will not heat up unless this switch is also on. <S> If you took the kettle apart and shorted out the switch, it would not trip off when the boiling point was reached, so this is very dangerous. <S> If you think you can also replace the boiling point sensor and run the logic through your processor, you should think about the fail safe implications of this and consider your house insurance situation. <S> But you could only boil it once before having to mechanically reset the switch. <S> If that works for you, fine, but bear in mind that kettle are not like lamps that you could just switch on and off whenever you like, and interfering with the switch is hazardous. <S> Most kettles that I have come across do allow the switch to be on even when there is no mains, but most toasters don't allow the basket to be latched in the down position without incoming mains, so you can see this could be a problem. <A> If you want to control a 110V mains power device, a "power switch tail" is available for markets that use the US-style 110V outlets: powerswitch tail <A> No, you don't have enough parts to build a circuit to switch on your kettle. <S> If it really is a basic kettle with no logic or low-voltage controls, then the switch is controlling your house voltage (110V/230V) directly. <S> The practical limit to an Arduino or any microcontroller is about 5V. Additionally, microcontrollers can only handle DC voltages. <S> If you tried to connect your Arduino to the kettle without any additional components, it would probably explode. <S> I would recommend that you use a relay to switch on and off your kettle. <S> It is relatively easy to find 110V/230V <S> AC rated relays, with current ratings large enough for safe switching. <S> It is a fairly simple circuit to set up; you need a relay, a driver transistor, and a diode for relay coil. <A> The current issue of MAKE (Vol. 25) has an article on controlling a crock pot, which is almost identical to what you'd need to do. <S> http://makeprojects.com/Project/Yobot-Arduino-Yogurt-Maker/499/1 <A> Use a mains relay controlled by the Arduino. <S> You need to take the usual precautions to ensure safety, of course. <A> This is a somewhat different approach, and no arduino involved, but you may like the Automatic Button Pusher for inspiration. <A> I just used an arduino to drive a servo to 90degrees then back again, and mounted the servo so it would actuate the kettles switch, I also used one of those solar cell battery's for charging your phone so that power is always therehandy with an xbee to remotely control it
Depending on the type of switch used in kettle, it might be possible to fill it and switch it on mechanically, waiting for mains to be switched on by the micro.
Plans / tutorial for sound effect generator using only analog components? I've been wanting to make a laser gun sound effect attachment for my son's bike. Currently, I'm using the electronics salvaged from his old laser gun toys. All of them seem to use electronics hidden under a black blob of resin or epoxy, which I assume is an ASIC? I'd love to be able to make this more cheaply, and was wondering if there's any resource out there to show how to make something like this with analog components. I have an old fart machine that seems to use a combination of resistors, capacitors, and inductors to generate multiple sounds (i.e. no microcontroller), so I figure that it must be possible. I only need one sound, but it would be great to be able to select from multiple, or somehow use a microcontroller + DAC to do it, although the latter would increase the price. EDIT -- something like this , but cheaper than $10 would be niceEDIT -- also found this schematic but it needs an IC called the HT2884 <Q> Back when I were a lad, the SN76477 sound effects generator ruled supreme. <S> If you fancy a bit of nostalgia they can be had for just over $9. <S> Admittedly, you need a few other components but they can make a ton and a half of sounds. <S> http://www.bgmicro.com/ICS76477.aspx <S> Edit: Just as an afterthought, one of the more irritating circuits that the lads in the electronics club at school used to make up was a 555 oscillator where the timing resistor from Pin 7 to Vcc was replaced by 10 variable resistors with diodes (or LEDs) in series, hooked to the outputs of a 4017 decade counter, which was clocked by another 555 timer. <S> By adjusting the variable resistors and the frequency of the 555 clocking the 4017 you could generate a string of 10 notes in a loop. <S> When this ran at a fast clock speed you got some weird noises. <A> it is not analog, but you can use R-2R Resistor ladder (acting as a simple DAC) on the outputs of a controller <S> or you can create a chain of counters addressing an E/EPROM in a loop, on Memory outputs again <S> R-2R ladder. <S> You can usee 2, 3 or more of the MSB address lines with switch to choose different sound <A> I think some of the answers for the question you've linked to give you some good ideas about how to do this. <S> PWM is a simple way to create a DAC, and you just need to program your microcontroller to output different frequencies until you find something that sounds like what your looking for. <S> When you find something that sounds good, you can then try to write an algorithm to match it in code on your microcontroller. <S> If you want to just use discrete components, then maybe you could build two Multivibrator circuits with different frequencies, and combine the outputs using an Op Amp circuit to drive a speaker.
You could use some sound wave editing software like Adobe Audition that has a wave generator that you can use to easily play around with different frequencies and immediately hear what they sound like.
Compare negative with positive, ignoring sign I need to compare a negative voltage with a positive one, each on the order of a few hundred millivolts each; I want to compare the magnitudes, ignoring the signs, although only for this particular quadrant (I don't need all other signs.) How can I do it? I thought of using resistors to pull the negative voltage positive, but it only gives me a small signal on top of a DC offset, and that is difficult to compare with. <Q> Couldn't you just place two equal resistors in series between the two signals? <S> The junction of those resistors would be their average, and has a sign matching the greater side. <S> It could then be compared to zero for amplification. <A> Use one of the following active full-wave rectifiers: <S> This just works! <S> The other one described in AoE on page 222 (requires bipolar source). <S> When you say "small signal" , that tells me you are comparing AC signals riding different biases, which means you can block both biases with blocking caps and compare with a differential amplifier (eg. "long tailed pair") . <S> Some diff amps take out bias by default (not related to CMRR ). <S> Another idea: scale the negative voltage up to above 0V with a few resistors, as in your first idea, then take care of subsequent bias with math and diff amp resistors. <S> V OUT will be this: Scale R 1 and R 2 such that the op amp positive input is always positive. <A> If you can tolerate a slight current into the circuit (adjustable by modifying the pullup resistors), you can use a diode to offset the voltage: /-- <S> o ----------o-------------------\ | <S> | <S> ___ <S> - ___ <S> | | <S> `-|___|-\ <S> `-|___|-\ |\| <S> | .--o-----------)---------|-\ <S> Output <S> | <S> | .---| <S> | <S> >--- | | | <S> \---------|+/ <S> --- <S> 5V V V |/| - - - | | <S> | <S> | <S> | /-----o--------)-------o--)---------------/ <S> | | <S> | <S> | <S> | <S> | <S> = <S> == <S> | <S> | <S> ___ <S> | <S> | .-. <S> GND --- <S> V- |-|___|-/ <S> \->| |POT - | SHUNT <S> | | <S> | <S> // <S> | Res '-' <S> o-----<|-/ <S> | | <S> LED <S> ___ <S> | \--------------|___|----/ <S> You'll need to give the pot the same polarity and ground reference as the shunt resistor, and you'll want to make sure that your diodes have identical forward voltages (use the same diode, and try to find one that characterizes Vf very precisely). <S> The pullup resistors to 5V should be very large, and the currents through them very small in comparison with the resistances of the pot and shunt resistor and their current values. <S> (Mega ASCII circuit created with AACircuit ) <A> I had some doubts about your needs. <S> What you want is to "remove" the signal and then find the difference between the signals? <S> If it is you may acompplish it using an precision rectifier to "remove" the negative signal ( http://en.wikipedia.org/wiki/Precision_rectifier ) and then an differential amplifier to get the delta between the signals ( http://www.electronics-tutorials.ws/opamp/opamp_5.html )
Multiple methods making electro magnetics malleable: Invert the negative voltage with an inverting buffer (op amp).
Which microcontroller has good linux supported simulator? I am looking for a good microcontroller to learn electronics. EDIT I want develop on linux, and I wish there is a good linux supported simulator. I want use C language. <Q> There is good Linux support for many microcontrollers: <S> Atmel's AVRs are well supported, with the GCC compiler and avrdude for loading code. <S> An Arduino makes a good development board for starting out. <S> Microchip's PICs are supported by MPLABX which provides compilers, IDE and code loading (using a PICkit ). <S> The SDCC <S> compiler supports 8051, Z80, HC08 and more. <S> A good precompiled GCC toolchain comes from CodeSourcery . <S> TI's MSP430 microcontrollers are supported with GCC and mspdebug. <S> See, http://hackaday.com/2010/08/11/how-to-launchpad-programming-with-linux/ <A> I am a big fan of the ARM-based microcontrollers; regular old GCC works (I use CodeSourcery's free compiler), regular old gdb works (as do all the gcc/gdb frontends), and JTAG interfaces such as the Olimex are inexpensive and work beautifully. <S> I used to be a big fan of PICs but having the development system stuck on a Windows machine just wasn't cutting it anymore. <S> I know about sdcc and other PIC compiler efforts but let's face it, why mess around? <S> Get something that works, has a large support base and doesn't require you to goof around. <S> An LPC2103 is inexpensive (2101/2102 being cheaper), has a decent amount of memory and resources and is offered in an LQFP footprint which is relatively easy to work with. <S> There are dozens of ARM7 or Cortex M3 based microcontrollers on digikey in LQFP packages. <S> (there are also hundreds more if you are willing to work with exposed pad or BGA packages.) <S> What you want depends on how many IO you're after, which peripherals and so on. <S> NXP, ST Micro and TI all offer parts though digikey that are in stock right now, and I'm sure there are many more if you want to check mouser, arrow, etc. <S> I really like the ARMs, but if they're not your bag CodeSourcery also offers gcc for MIPS (this should include PIC32), NIOS (for your CPU embedded in an FPGA), and SuperH based microcontrollers. <S> I have no direct experience with any of these, as I'm more than happy with ARM. <S> You don't need to use their gcc either; you're free to build your own compiler, but I've been really happy with them and plug them whenever I can. <S> They put out a free version that technically has no support, but they are receptive to queries from hobbyists and their mailing lists are great. <A> I don't know of any quite good simulators - because the few free simulators I know of are not updated for new MCUs. <S> For AVRs we have SimulAVR , and for PICs we have gpsim . <S> A few manufacturers, like XMOS , make an effort to provide tools for multiple platforms. <S> Most do not include simulators, but theirs should. <S> When simulating an instruction set for academic purposes, rather than an entire microcontroller, I've used GXemul . <S> For higher performance emulation <S> QEMU can be useful.
ARM microcontrollers are well supported, with GCC and OpenOCD +GDB for JTAG loading/debugging.
Where to find 478 motherboard circuit schematics? I have searched for 478 motherboard circuit schematics on the internet, but have found none. Are any available publicly? <Q> I wouldn't hold out much hope. <S> I've looked at motherboards and while they don't look complicated per se the sheer size of the design (number of nets) is bound to be daunting. <S> Plus I imagine the file format of the schematics will be for a rather high-powered schematic capture program costing several thousands of dollars. <S> I see you didn't find much for reference designs. <S> You might have luck finding reference designs for each individual chip (sound codec, south bridge, north bridge, etc) on the board and looking for reference designs. <S> Ideally a motherboard should just be all of those designs put together, but I'm sure there's several hundred catches (matching impedance for long traces for instance). <A> I agree with AngryEE -- it's unlikely you will find a complete schematic for a 478 motherboard. <S> However, would something slightly different, such as one of the following, be adequate for whatever it is you are trying to do? <S> If you are looking for the complete schematic for a relatively modern motherboard,there are several "motherboards that run Linux" with a complete and freely-available schematic. <S> http://opencircuits.com/motherboards_that_run_Linux <S> If you are trying to lookup what all those pins in a (obsolete) 478 socket do,perhaps you will find the answers in the datasheet for"The Intel® Pentium® 4 Processor in the 478-pin Package socket". http://www.intel.com/design/pentium4/datashts/249887.htm <A> I, for one, have actually designed a motherboard based on an Intel CPU. <S> So I have some direct knowledge of how to get schematics. <S> But you need to get an agreement going with them that includes a Non-Disclosure-Agreement (NDA). <S> And Intel will only do that with you if they believe that there is a money-making opportunity for them. <S> But with the NDA signed, getting the schematics is easy. <S> All you do is ask your Intel contact person!
Intel will give you schematics for their reference designs (which are very close to the Motherboards they actually sell).
How to implement a soft power switch controllable by microcontroller? I want to design a circuit such that the microcontroller can toggle a GPIO pin and shut the whole system (including microcontroller itself) down. And when the user presses a momentary button, the power is brought back up again. Is this possible? <Q> This example uses a Maxim MAX1835 step-up regulator, but could be applied to others as well that have a shutdown pin. <S> The circuit is normally powered down. <S> When the user presses the pushbutton, the battery is fed into the -SHDN pin, enabling the regulator and turning on the 3.3V to the microcontroller. <S> The microcontroller then puts a logic 1 on the POWER ON lead, holding the power on after the user releases the pushbutton. <S> When the microcontroller wants to shut itself off, it sets the POWER ON lead to 0. <A> One way of doing this is to enter a deep sleep mode on the microcontroller. <S> Many microcontrollers support being woken up by an external interrupt, such as an edge on an IO pin. <A> Yes, this is certainly possible, but how you achieve this depends on what kind of load you're going to be switching on and off. <S> Here is a simple example circuit diagram: When using a momentary push button switch, be careful of debounce though, you'll need to implement a delay in your microcontroller code to ensure that you check the status of the push button over a period of time (e.g. 1ms) before switching your relay back on. <S> If you don't, then the microcontroller might pick up multiple signals and switch your relay several times in a very short space of time, and you'll find that your button works intermittently. <S> UPDATE <S> I just saw your edit about powering the microcontroller down as well. <S> Can you give some more information about what your actually trying to do? <S> It's difficult to answer your question without understanding the whole system. <S> If you want to shut the microcontroller down as well, then you'd need some way of getting power back to the microcontroller. <S> Maybe you could use the relay to power everything including the microcontroller, that way the microcontroller can switch itself off, but not back on. <S> Then your push button could be connected across your relay switch, to effectively short it out giving it enough time to power up and hold the relay open itself.
It's probably as simple as just using a relay connected to the output PIN of the microcontroller (via a transistor and protection diode), and a push button switch connected to a pin configured as an input.
How to approach designing a 30GHz bandpass filter? How would one approach designing bandpass filters in the 3GHz - 30GHz range , each with ~2.4GHz bandwidth, for a 50Ω spectrum analyzer or sampling oscilloscope? I've learned how to implement some simple RF designs in the 1GHz-5GHz range, and some of what to look out for. What circuit topologies are used? (Eg. coupled line vs capacitive-gap resonator vs capacitive coupled shunt resonator.) Any active components? What bandwidths and falloffs can be expected? <Q> For 30ghz, there likely are no commonly used active filter topologies. <S> However you can use galium arsenide FETs in this region to build various circuits (PA, LNA, mixer, VCO, etc), never seen them used at 30ghz but have seen them used for 24 Ghz <S> I would think you could extend their operation to 30Ghz if care was taken. <S> Passive filters will definitely be implemented with microstrip structures, lumped elements will not be useful at these frequencies. <S> You'll also need to find a very good substrate to work at 30Ghz. <S> Falloff is dependent on the topology you use and the number of poles in the filter much as it would be at lower frequencies. <S> For instance Chebyshev filters are common. <S> My only experience near such frequencies was a 24Ghz FMCW radar front end, that used GaAs FETS for the PA, VCO, mixer, a hairpin bandpass filter and was built on Roger 5870 substrate. <S> I didn't do the RF design <S> this was an externally sourced design and we ended up using a 10.5Ghz variant of it. <S> My initial thought is that your desired bandwidth is really wide, and that will greatly complicate the design. <S> Your best bet is to get a couple books on RF filter design, make sure your up on your calculus and start running some simulations using various topologies. <S> Ansoft Designer and Microwave Office are the two simulation packages that i've bumped into in the past for RF circuit simulation. <S> I believe they both have free trials. <A> Which simplifies your problem somewhat. <S> But it doesn't mean that designing either of the two component filters for operation out to 30 GHz will be easy. <S> With this wide a band, you will probably not be able to use any simple transmission line structures to implement your filter, because that generally only works over a fraction of an octave. <S> Some kind of distributed structure (multiple stubs of different lengths connected periodically to your main line) may be possible. <A> 30 odd GHz is quite a bit of bandwith. <S> There may be some useful info for you {here} .
Very late answer, but, I would think that 3 - 30 GHz is a wide enough passpand that you can implement the bandpass filter by cascading a low-pass filter (at 30 GHz) and a high-pass filter (at 3 GHz).
My country's voltage is 220 and I want to recharge a Japanese cellphone (100V), what should I use? I live in the Netherlands and can't recharge my Japanese cellphone because I think it's due to the difference in voltage.What should I use in order to recharge it anyways? Thanks!! <Q> If its a major brand Nokia, SE, Samsung to name a few. <S> Get a local charger and use it, its the safest approach. <A> What is the nameplate rating? <S> A lot of newer chargers use PFC, which allows them to work from 85Vac all the way up to 265Vac... <A> First you need to check the voltage rating on Japanese cell phone charger. <S> If the rating on the converter is ~110v <S> to ~220v <S> , that means the charger can take 220v as well. <S> All you need is a plug adapter which you can use with existing charger. <S> The plug adapter just allows you to plug-in your charger with square pins to your power socket. <S> If the voltage on the charger is just ~220v, there are two options: <S> You can purchase a 'step down voltage converter' which can convert your power voltage to 110v for your phone. <S> You can purchase a converter at local electronic store.
Or Buy a new cell phone charger with the same output voltage as your Japanese cell charger.
Cheap way of temperature testing my boards I want to make sure my product will work over a large temperature range of -40C to +75C. I can verify on the low end down to about -18C using a household freezer (which is probably good enough) but I'm not sure how to test it on the high end. Any tips? <Q> I've resorted to cardboard boxes with air holes cut into them - allow the product to slowly warm the air inside to the desired temperature and control ventilation to keep it somewhat steady. <S> If more heat is needed, put a power resistor inside the box and use a regulated DC supply to control how much heat it adds to the environment. <A> For the high end, you could use a hacked sous vide cooker with a PID controller. <S> http://hackaday.com/2010/11/06/hacking-together-a-sous-vide-cooker/ <A> Can you use an oven? <S> Mine can be set to a low around 75 degrees C. <S> I've done cheap temperature cycling tests before by quickly swapping a device between my oven and my refrigerator freezer. <A> Heat gun / paint stripper with adjustable temperature control pointed into an enclosure around your PCB works for the high range, and Circuit Freeze will work on the low end (goes down to -62F). <A> When I was temperature testing an industrial design <S> It didn't smell particularly good <S> but I imagine an insulated metal "box in a box" type design would work very well for your 75C test. <S> Take a look around to see how people make casting furnaces and do something similar. <A> I once made a small oven to dry my photosensitive lacquer PCBs. <S> It was basically a matrix of 1W resistors directly 230V AC powered. <S> I mounted the resistors 1cm above a PCB so that the air could flow freely around them and the heat was distributed well without hot spots. <S> This heater was temperature controlled by a (unfortunately long obsolete) TDA1024 + NTC temperature sensor. <S> The TDA1024 can be replaced by a transformerless power supply to feed a comparator. <S> My thermostat was set at a fixed 50°C, but with a potmeter you can vary the temperature.
I used an old refrigerator; cut a hole in the door and used a heater to drive the temp up to 40C. I'd just use a TC to measure the actual temperature as the oven readout may not be very accurate.
What kind of components are black blobs on a PCB? In low-cost mass-produced items I often run into black blobs of what looks like resin applied directly on top of something on the PCB. What are these things exactly? I suspect this is some kind of custom IC that is layed out directly on the PCB to save on the plastic housing/connector pins. Is this correct? If so, what is this technique called? This is a photograph of the inside of a cheap digital multimeter. The black blob is the only non-basic piece of circuitry present, along with an op-amp (top) and a single bipolar junction transistor. <Q> The die is glued to the PCB and wires are bonded from it to pads. <S> The Pulsonix PCB software I use has it as an optional extra. <S> The main benefit is reduced cost, since you don't have to pay for a package. <A> Like Leon said the techniques is called Chip-on-board (COB). <S> You do exactly the same to bond the die directly to the PCB as you would to bond the pins in an IC package. <S> Savings: no package needed. <S> (You could say no soldering also, but that has to be done anyway, so that's not really something you save on). <S> COB is not cost-effective for small series, and with a few exceptions you will only see it on mass-produced products (100k~1M/year). <S> The blob is an epoxy resin to protect the IC with the bonding mechanically; the bonding wires are very thin (as thin as 10\$\mu\$m for gold wire) and therefore extremely fragile. <S> Another form of protection it offers is reverse engineering protection . <S> This is not fool-proof (the resin can be removed), but it's a lot harder to reverse-engineer than simply desolder an IC. <S> IP protection example: until a few years ago FPGAs always needed an external serial memory to load their configuration from. <S> This configuration could be an almost complete product design, and therefore expensive. <S> Yet, simply by tapping the communication between FPGA and configuration memory <S> everybody could copy the design. <S> This can be avoided by COB-ing FPGA + memory together under a single epoxy blob. <S> note: <S> the die in a BGA is also bonded on a thin PCB, which routes the signals from the edges of the die to the ball grid at the bottom. <S> This PCB is the base of the BGA's package. <A> It is a "Chip on board". <S> It is an ic wire bonded directly to the board, and then protected with some epoxi (the "black thing"). <A> I know this is an old question, but there is one aspect of COB that was not mentioned. <S> The issue is that you must start assembly with Known-Good-Die. <S> IC components are nearly always tested after they are packaged. <S> It's simply easier to handle a packaged component than it is to place tiny probes on the unpackaged chip. <S> This is a problem for COB because if you place an untested chip, you potentially have to throw away an entire assembly if that chip turns out to be bad. <S> So, COB usually must use KGD. <S> The chip testing is usually done at the wafer level, before the die are diced (sawn apart). <S> Unfortunately this testing is usually slow and expensive (relative to testing in packages) <S> so this consumes some of the potential cost savings of COB.
It's called chip-on-board.
How do I implement accurate distance measuring (to ground) on a plane-like UAV for heights over 10m? How do I implement drone-to-ground distance-measuring for autopilot landings for heights over 10m? I found ultrasonic to be too inacurate, let alone GPS. Maximum height is 1000m, Vmax is 100 km/h, Vaverage is 72 km/h. The drone is plane-like, no *copter or so. Thank you for any input! <Q> You are probably looking for a radar altimeter, but I think that 1000m height will be a challenge if you want to build it yourself, because of power required to get detectable reflection at such distance. <S> Couple hundred meters may be more realistic target for home made low power radar. <S> Here is schematics of radar landing altimeter that is usefull to about 1000 feet. <A> On real aircraft, they will have both a Radar Altimeter and a Barometric Altimeter. <S> The Barometric Altimeter is used at higher altitudes and the Radar Altimeter is used during takeoff and landing to gauge distance to the actual ground (i.e. at altitudes where terrain elevation changes are a significant concern - typically 5000 feet). <A> In reality, a single sensor will probably not be accurate enough to do what you want. <S> Most of what I know is related to AGVs (Ground Vehicles), but I think that some of the same principles apply. <S> You probably want to use a combination of sensors to get the accuracy that you need. <S> Some of these can be quite expensive. <S> GPS: A standard GPS module should be able to get you down to about 1m +/- <S> accuracy. <S> If you step up to a differential setup (one station on the ground, one on the plane), then you should be able to get significantly more accuracy, but at a much higher cost. <S> Something like 10cm or <S> even 1cm should be possible (with velocity data), but with a significantly higher cost. <S> INS: You can supplement your GPS system with intertial measurements. <S> The boom in MEMS devices has made relatively decent solid-state sensors available at consumer prices. <S> Adding accelerometer, gyrometer, and magnetometer data to the GPS data should make the signal more accurate, and account for possible "glitches" in you GPS readings. <S> Radio-assisted navigation <S> : I'm not entirely up on this, but many airports use a radio-assist to help land the planes. <S> You may be able to research how these systems actually work and implement your own (legally, of course). <S> For a more detailed look at some of these considerations, I would check out DIYDrones. <S> They have put together some pretty tightly-integrated systems using GPS, INS, Barometers, and a large array of other sensors. <S> They have also tackled some of the difficult filtering challenges that come with multiple sources of data in an airborne system. <A> A barometer would do quite well <S> you get something like 10 cm resolution, the only tricky bit is that your drone will need to know the barometric pressure at ground level and that tends to change with the weather. <S> If you want really high performance location control, then you will probably not get around a vision based system with a high-power computer that can recognize the the landing strip and hit the right zone at the right speed. <A> If you are going to land on landing sites under your control, I would place several radio emitters around the site and compare signal power. <S> That's the only reliable & easy to implement way. <S> If you want to land anywhere - only GPS (+-1m possible in USA), ultrasonic or laser measurements are valid options, but none of them are perfect. <A> The measured result may change rapidly if you're going over terrain that has a lot of variation (such as a forest or city), and it may be hard to get a reading over reflective surfaces such as water which will not return much of the beam in the direction it came. <S> However, this should be considered as an option. <S> Consumer handheld rangefinders for hunting or golf run from $50 to over $200; I'm not sure about commercial prices for integration into a system like a UAV. <A> I always wanted to try this: Mount a downward-facing camera on the UAV. <S> The quality is mostly irrelevant. <S> Grab frames from it at some fixed interval. <S> Analyze pairs of images to determine how fast the ground appears to be moving. <S> There are a lot of options here for algorithms. <S> Now, given your GPS speed (not airspeed!) <S> you how how fast you are actually going and how fast the ground appears to be moving. <S> At 0 altitude the (properly scaled) apparent movement would be 1:1. <S> As you gain altitude the apparent speed of the ground would slow down.
A laser rangefinder will give you good precision and accuracy, and is designed for your expected distance, but may be heavy (due to the optics) and will resolve the distance to a point rather than a larger area.
Voltage regulation and current limiting with a microcontroller I'd like to build a power supply for my desk. I've found a few projects based on the L200 adjustable voltage regulator. In the example below, how could I replace R3 with a microcontroller, so that varying the current limit can be automated? Likewise, how can R2/R1 be controlled? Is there a better device for a task like this? <Q> To replace R2 you can use a digital potentiometer or "digipot". <S> It acts like a resistor where the resistance can be controlled over a digital bus such as SPI. <S> It might also work for R3 <S> but I'm not sure how much current it has to carry; if it's small a digipot would work there as well of course. <S> A switching approach might be smarter though, since it would be cheaper and more efficient although more complicated to design. <A> This looks like a good project which does everything I need. <S> http://www.tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml <S> http://shop.tuxgraphics.org/electronic/detail_microcontroller_powersupply.html <A> Use an MCU as a switching regulator, with a suitable MOSFET and inductor. <S> Microchip has several application notes on such techniques. <A> Pin 3 is a ground. <S> Use this to your advantage; the outputs on a microcontroller can be set to either tristate or ground. <S> Then, using an array of resistors, you can program the voltage by pulling down binary combinations. <S> For best results use binary or close to binary values, for example, 10, 22, 39, 82, 150, 330, 680, 1.2k... <S> It's limited in resolution to 2^n steps, where n is the number of resistors. <S> Not sure how to control current limit but you could try a similar approach with an op-amp as a current limiter and a similar voltage divider as a reference and just set the regulator current at a high limit so a short doesn't damage it. <A> Controlling the OCP limit would most likely require a digipot, as would significant adjustment of the setpoint.
Consider using a DAC output and a high resistance (relative to R1) to inject / sink current into the pin 4 network to facilitate a 'trim' feature.
Controlling a mechanical shutter with an electromagnet I'd like to drive a pair of mechanical shutter / apertures with an electromagnet. For those curious, we're using a shutter from Edmond optical . For the particular application, I'd like to design a compact actuator to drive it. (I had considered just hacking a camera lens with a shutter, but couldn't find one that was large enough for my needs). So at present I am thinking about attaching a neodymium magnet to the lever of the shutter and then using a series of electromagnets to push it between open and closed. Which all leads to my first question: how can build compact electromagnet? It seems like the steps involved are to find a solenoid and then to drive it with a decent voltage difference. I wonder if anyone could recommend a good small solenoid for such purposes. Does it make more sense to roll my own with an iron core and insulated wire? My second question is more open-ended: can you think of a better way to drive such a shutter? How would you design the shutter motor? UPDATE: in response to comments: @tyblu the shutter needs to be open or closed in about 500 microseconds (but exactness is not important). @bt2 a solenoid is interesting, are you thinking of hitting the lever and letting momentum carry it across to the close position? <Q> You could use a servo with a linkage arm to close the shutter. <S> I'm looking at doing this right now, except I need to precisely control the aperture. <S> A servo will give you (relatively) precise position control, and it's fairly easy to interface with. <S> I wouldn't, however, recommend building your own. <S> There's plenty out there that'll do the trick and probably work better than you can design - it'll also save you time. <S> You'll need to use a spring to restore the shutter to the open position. <S> You might try searching Digikey.com to find some. <A> As was already stated if you want to be able to control how open it is <S> then you will need some kind of linear actuator and a mechanical linkage to the lever that opens and closes the aperture. <S> If you are just alternating between totally open and totally closed then an electro-magnet may work. <S> A Google search for linear actuators may provide you with what you are looking for. <A> You need to rethink your requirements. <S> Opening and closing a mechanical shutter in 500 microseconds is an extreme demand. <S> Most mechanical shutters take several times as long to open completely. <S> The shutters in SLRs achieve sub-millisecond exposures by opening partially and moving the opening across the frame so each portion "sees" light for a brief interval, but the overall exposure takes longer. <S> Extremely fast opening and closing times <S> are the domain of electro-optical shutters .
If you need to close the shutter very rapidly, then your best bet might be a solenoid.
magnetometers: do they work all over the globe? Are there any places on the globe where magnetometers won't work? For example, if you took a Honeywell HMC5843 to the North or South magnetic pole, would they fail to function properly? <Q> You wouldn't be able to use it as a compass exactly at the magnetic pole, as the magnetic field would be vertical. <S> You probably already know about the need to correct for magnetic declination , which is the angle between magnetic north and true north. <S> It varies irregularly over the earth and over time. <S> Take a look at a declination map (such as this one ), and notice that there is no unique value for declination at the magnetic poles. <A> Surely they would not fail, they will show you the magnetic field just like anywhere else, it will just be quite wierd. <S> You still will be able to use it as a compass there if you would get approximate GPS fix to correct for magnetic pole location (but math would be way harder in comparison to usual "dumb" compass). <A> Justin's answer is spot on -- the magnetometer will work anywhere, but the readings may not be useful to you at the magnetic poles. <S> Regarding magnetic declination & inclination, there's software for a World Magnetic Model published by the US NGA & UK DGC that returns the expected magnetic fields strength & direction for a given location/date. <S> http://www.ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml <A> A magnetometer will 'work' <S> anywhere there is a magnetic field that is large enough to be detected by that particular sensor. <S> This is determined by the noise floor of the sensor, i.e. the magnitude at which the S/N ratio is large enough that the signal information can be recognized over the system noise level. <S> And direction matters. <S> Even for vector sensors. <S> I don't think that there is anywhere on Earth, or in the Solar System inside of the orbit of Venus, where, say, a squid (or a SERF) couldn't detect a magnetic field. <S> I think there are many fluxgates that could detect a magnetic field anywhere on Earth (which, off the top of my head, is around 0.5 Gauss - a very large value). <S> The important thing to recall is that there are around a dozen major classes of magnetic sensors and they all have different specs, the main one being the resolution (i.e. the smallest signal they can detect, - the noise floor). <S> Why do you want to find a place they don't work?
So the magnetometer works everywhere since it gives you the correct magnetic field X/Y/Z components; you just can't always use it as compass.
Safe current limit for human contact? What's the point below which electrical current is generally considered safe for "casual" human contact? Is either voltage or amperage more "dangerous" (e.g. high voltage / low amperage vs. low voltage / high amperage), or is the only consideration the total current? <Q> Here is an article titled "A review of hazards associated with exposure to low voltages" which I used as a reference when answering a medical safety question (I design embedded hardware and firmware for medical devices which go through FDA approval). <S> Because the body has a minimum resistance of around 550 ohms, to get enough current to do damage <S> a minimum theoretical voltage level of around 16.5 V peak is required (corresponding to a current of 30 mA peak , which can induce respiratory paralysis if conducted across the chest for several minutes of contact at this low voltage). <S> For less than one second exposure, >100 mA peak and 55 V peak are required. <S> The author states that in all the cases he studied, there was no accidental electrocution from short-term exposures to voltages below 50 V peak . <A> As rules of thumb, I've generally thought of myself as a 70 kΩ resistor to ground that feels pain at around 1 mA, which can be driven by 70 V or so. <S> In my experience, the pain threshold is slightly above 48 V. <S> I can't say that I have any good medical science to back this up, but there are a few empirically obtained data points in that I'm not dead yet. <A> Voltage doesn't really matter, it's a requirement to get a certain voltage to pass through the skin, but voltage doesn't have any impact on "damage". <S> Current is what does damage. <S> I've heard tons of claims as to what will kill you. <S> In EE school is was 60mA AC and ~100mA DC across your chest that would send your heart into fibrillation. <S> I've seen claims that < 10mA directly through your heart could do the same. <S> Honestly both are probably correct. <S> I don't know what a real electrical model of the body looks like, <S> but I don't have a hard time believing that if there were 100mA running through my body from one hand to the other that only 10% would pass through my heart directly. <S> I've worked on live phone lines before (~58V DC with off hook) and that didn't pass through my skin initially. <S> A half hour of being in the 105°F degree attic and sweaty hands later, it made my finger twitch and didn't feel good. <S> On another occasion I was working on a phone line when someone dialed it... <S> that sucked... <S> the ring pulse is 120V AC (current limit though) and does not feel good at all. <S> It only takes a couple milliamps to seriously get your attention, 10+mA will lock up muscles, this is highly frequency-dependent though. <S> To get back to your point... <S> greater than 100-200mA is when you'd expect to start to see flesh burning and things like that. <S> But obviously from the heart discussion above, localized currents that are much smaller <S> can be deadly. <S> I don't really know if there is a firm rule as to what's "safe". <S> The current debate over the use of tasers, for example, would seem to indicate there isn't much conclusive evidence. <A> The HAM Radio Technician Class examination question provides this answer: 2010 Pool - Question T0A01Category: <S> T0A - AC power circuits; hazardous voltages, fuses and circuit breakers, grounding, lightning protection, battery safety, electrical code complianceWhich is a commonly accepted value for the lowestvoltage that can cause a dangerous electric shock?A <S> 30 volts
For less than one minute of contact, currents >40 mA are required to cause ventricular fibrillation, corresponding to a theoretical voltage of 27.5 V peak . Based on the cases studied by the author, the single lowest voltage reported to cause transdermal electrocution in an adult is 25 volts.
Short circuit protection for a boost converter Is it possible to add short circuit protection to a boost converter? My initial instinct was no , as the switch does not directly control the input to the inductor and this means the minimum output is Vin or so. But are there ways to protect such a converter? <Q> Here's a linear tech app note http://cds.linear.com/docs/Design%20Note/dn154f.pdf <S> If you're not using much current, sometimes a simple solution is to just use a thermal fuse in front of the converter, or even a simple lm317 type current limiter. <S> The second will give you a voltage drop, which may or may not be a problem. <A> In boost PFC applications, there is peak current limiting usually through a combination of two current transformers (one sensing the switch current, the other sensing the diode current) which works by collapsing the duty cycle of the converter, reducing the output voltage and (if the load is not CC) <S> the current. <S> There is no way to protect against a hard short except for opening some sort of limiting device (i.e. fuse) <A> The problem with boost converters is there is a DC path through the diode, so shutting off he converter doesn't stop the DC path. <S> A seperate overcurrent protection circuit is usually the only solution. <A> A SEPIC converter can be current limited, here's an example: http://dren.dk/carpower.html
Another easy solution is a good current limited voltage regulator in front of the boost converter and dedicated only to the boost converter, so if there is a short it doesn't bring the rest of your rail down.
How many resistors do I need for an 8 switch DIP switch block? I was thinking of giving each switch it's own pull-up resistor, but this seems like it would be expensive and a little bit of overkill. But using just one pull-up for the entire block seems like it might overload the resistor (unless I just use a big one). Are there any guidelines in this situation? <Q> SMD resistors are as cheap as dirt. <S> Especially if you would buy full roll of let's say 10k ones (i.e. something widely-used, so that you could use in multiple projects). <S> It's hard to overload pull-up resistors, as they can dissipate 0.125W usually. <S> There are also 4 and 8 resistors in 1 package, this will be even cheaper if you are on large scale. <S> You cannot use single resistor for multiple wires - as they will be shorted (or you will need diodes :-D ) <A> Depending on the application, you may have built-in pull-up resistors. <S> AVRs like the ATmega168 and '328 do… <A> If your micro has no pullups, another approach is to common one side of all switches, connect to an input with a pullup, and connect each of the switches to other IO pins. <S> The latter pins are all tri-stated except one at a time, which is pulled low to read the state of its switch on the input pin. <A> If you connect all your switches to the single resistor all your switches will be parallel, and you'll have only 1 output instead of 8. <S> In fact this is a NOR gate: if at least one switch is closed the output will go low, if all switches are open the output will be high. <S> This may have its application, but it's not the functionality you want. <S> Like BarsMonster says resistors are cheap (not only the SMDs). <S> Don't buy a single part, a single 1/4W carbon film resistor costs 8 cent at Digikey, at set of 100 costs 2.2 cent per resistor. <S> Have a few standard values at hand, like 1k\$\Omega\$ (typical for a transistor's base resistor) and 10k\$\Omega\$ (typical for pullup).
You need a pullup resistor per switch.
Is it possible to make a JTAG interface with an arduino? If so, could one direct me to a site that tells how to do this? I believe I may have found a way , but I am unsure as to whether or not it would work yet (need to find something to test it on). This question is related to a previous question of mine located here. In case more background information is needed. <Q> There are three problems, voltage, speed and drivers. <S> The Arduino natively runs at 5V. Most ARM microcontrollers are not 5V tolerant on their JTAG pins and require 3.3V. <S> The easiest solution is to run your Arduino at 3.3V, failing that you will need some sort of level conversion (see I2C 3.3 to 5.0 V conversion for ideas). <S> The Arduino is connected to a PC via a serial link. <S> I doubt it can feasibly go faster than 115200bps, which will make interactive activities like stepping through code in a debugger very slow. <S> But, you'll be able to upload code and reflash devices. <S> JTAG is a high level protocol, specific to each processor family, which uses a SPI like interface to exchange data. <S> Most JTAG dongles just provide a SPI interface over USB then leave the rest of the work to a PC application. <S> OpenOCD and URJTag are popular choices. <S> You will need a driver in one of these for your Arduino JTAG protocol. <S> The Bus Pirate is very similar to the Arduino (low speed microcontroller + FTDI chip). <S> It supports JTAG with OpenOCD, so it's certainly possible. <S> If you use a Teensy/Opendous or other AVR-USB board, you could use eStick-JTAG . <S> But, for lost cost JTAG, I'd recommend one of the FTDI2232 based dongles. <S> They're cheap and well supported by OpenOCD. <A> It's possible but very difficult. <S> I don't like the FTDI based JTAGs, because the FTDI chips are ready made black boxes and <S> one doesn't really learning by using them. <S> If I wanted to build an USB-JTAG with AVR <S> I'd get one with at least usb full speed support in the chip. <S> Then get the AVR usb stack (c source codes) and look at an usb-to serial example. <S> Since bitbanging over usb is a bad idea (high latency), it needs to be converted to higher level commands that will instruct the MCU to do the bitbanging itself (or use SPI if possible) & return the high level result over usb (complete <S> bytes).But then comes the need of writing drivers for the IDE to support the new JTAG device to debug over it. <S> OpenOCD and URJTag have source code of drivers for many jtag devices, so you`ll need to get and rework one for your newly invented device. <S> See how some people have done similar work: http://code.google.com/p/estick-jtag/ <A> Look at openocd. <S> The backends are mostly based around the parallel port bit bang approach, I think it goes so far as to change only one bit at a time. <S> It is fairly simple to take what I think they call the dummy backend which is an example. <S> Send whatever write bit command to the arduino, and have it set or clear that bit. <S> When asked to read the input bit then send a command to the arduino to perform that task and return the results. <S> I have done exactly this with success, but not with an arduino, I had openocd talk from a host into a simulated arm core running in a hdl simulator. <S> Note that some jtag specs are closed, the cortex-m3 for example is some sort of serialized reduced number of pins jtag which last time I looked was not available without an NDA. <S> that may not matter because openocd takes care of all that for you so long as you are using a jtag interface that openocd supports, the bit banged back <S> end is where your arduino and whatever interface you use to get to/from <S> it come in to play. <S> As noted already by Joby, you need to be careful with voltages (not all arduino flavors are 5V and <S> not all arm controllers are 3.3 volt) and signal conditioning and grounding and all that stuff. <S> If your target board is powered by a supply that is at a different level compared to what you power your arduino with you could melt something down when you connect the two. <A> It is possible, and I actually implemented it and explained all here . <S> There is a library on github here <S> that consists of two parts: the program that runs on arduino and a python script that sends XSVF files to the arduino. <S> You will most likely need a few resistors to convert 5 V to 3.3 V, as most FPGAs and CPLDs use this voltage level. <S> I also did some experiences writing an assembler/disassembler for XSVF files, the code is in the same github library and is explained in this post here .
Yes, it is possible to turn an Arduino into an ARM JTAG adapter.
What is equivalent to a daily build (and smoke test) for schematic designs? Daily build in software is taking the source code, compiling it and generating the executables, then running that nightly. This is considered a best practice since it catches errors that prevent the build sooner rather than later, which makes it easier to fix. And if the build works, then others can make sure they aren't introducing errors. What would be the equivalent for a schematic design? Clearly I can't build the PCB, but there might be something more than generating the netlist. Edit 1/21/11: Also a smoke test is running some tests against the build. Again, not possible. I like the DRC (design rule check) idea, I'm thinking of checks such as that. Edit 1/24/11: I was think of the schematic since that's what I do, rather than the PCB. <Q> I don't think there's an analogue of the daily build for hardware. <S> It may be possible to not allow a schematic to be checked in if it doesn't pass DRC (or maybe simulation) <S> but that's about all I can think of. <S> Software folks have the benefit of actually being able to run the finished product (for the most part) at a moment's notice and they get a lot of automated tools. <S> Schematic capture programs and simulators are for the most part not up to speed on automation, versioning, etc <S> and it's really a shame. <S> I'd like to see the software design process mimicked as much as possible for hardware <S> but I doubt it will be entirely possible. <A> One little nit: Only really sloppy developers use daily builds because one build a day means having to wait up to a day to find out if you broke the build. <S> Doing any sort of automatic testing on a schematic or a board layout might be very hard or impossible, but everything you can automate should be automated via something like Hudson, <S> things that come to mind are: ERC DRC BOM updating (check that the parts exist, are available and calculate total cost) <S> Generate Gerbers and other manufacuring files. <S> Generate PDFs of the schematic and PCB layers as well as 3d renderings of the PDB, BOM diff and other documentation. <S> Drop a mail to the developer mailing list with the commit message and links to the output files, so developers can review the change easily. <S> The number of errors that can be caught automatically might not be terribly high, but having the CI system generate the output files means that it will happen correctly every time and that you don't forget some silly setting when doing it manually. <A> I suppose if your tools support it you could export netlists and do something with them that you find is very repetitive and mundane. <S> One useful thing I can think of is generating the bill of parts. <S> I used to work at a small company that would design the hardware schematics and netlists and specify the parts, and then we outsourced the layout to PCB design experts. <S> We had a very helpful Excel VBA program to read in the netlist and generate the parts list from a database of parts. <A> The idea of a daily software build is to catch problems introduced by changes. <S> If you change the schematic, you'll need to test the PCB before going to manufacture. <S> You can reduce the risks by logging and reviewing all changes. <A> I think the closest equivalent is to develop the production testfixture and test script for your circuit as soon as possible. <S> Makesure you test all important functionality. <S> The test fixture emulateswhatever user interface and sensor hardware are attached to thecircuit. <S> The "design verification" test script will probably havemore tests and take longer than the production test script, where youare mostly testing to see that the pieces are connected togetherproperly. <S> So when you are making changes to the firmware or the circuititself, you can occasionally run the design verification test againstit to make sure you haven't caused any regressions. <S> It is alsohelpful to make reduced test scripts to test one aspect of thecircuit's performance, for example testing response across supplyvariations, or a particularly tricky state machine that would requiretwo pages of instructions for a human to attempt. <S> These shorterscripts are to save time and give better test coverage than the fullscript. <S> But you always run the verification test before committingchanges to the schematic or firmware. <S> For final released design run the verification test across temperature.
The best solution is to build and test every single change individually before letting it hit the public branch and revert the change if it breaks the build in any way.
Is FCC certification required for something that is not sold? Is FCC certification required for something you put together for personal use or only for something you actually sell to someone else? <Q> If you build it for yourself, it would fall under 15.23 so FCC authorization isn't required, but you still need to design/build it in a way so that it doesn't disrupt telecommunications. <S> See http://edocket.access.gpo.gov/cfr_2010/octqtr/47cfr15.23.htm <A> Certification is required for commercial products. <S> IANAL <S> (I am not a lawyer) , by the way. <S> There are some other caveats to keep in mind; if you build something powerful that ends up burning down your house or maiming someone, and your insurance provider finds out that it's not 'approved', your chances of getting coverage are likely slim. <S> If you're tinkering with 5V / 12V stuff at low power, not emitting tons of RF and not polluting the mains, you're probably OK. <A> You aren't required to certify hobby stuff, but you still need to stay within guidelines. <S> You really need to spend some time on the FCC regulations, but the quick rundown is that really low power stuff may be allowed if it only radiates in certain bands (and certain very low power levels). <S> Higher power requires the user to be licensed. <S> Exact license depends on the power level and band. <S> Some levels and bands are simply not permitted at all. <S> An amateur radio license gives one a pretty large area to play in (both band-wise and power-wise).
I believe that you aren't required to certify hobby electronics, but you still may get a knock at the door if your product is interfering with someone's commercial gear next door. Certification is also required for anything that plugs into the telephone network.
Can I use an Arduino as a USB to serial interface? I have a BluRay player that can be programmed by accessing to a serial console, as described here . I have an Arduino (a Seeduino, actually), that has a USB interface. According to Arduino's documentation, pins 0 and 1 are RX and TX. Do these pins bypass from what the computer sends? Can I use the Arduino as a USB to serial interface for what I need? <Q> Take a look at this post by Ihsan Kehribar: Using Arduino as serial to usb converter <S> In this post it is shown that you can use the FTDI chip on the Seeeduino as a serial to usb converter, you just need to run a simple sketch to make sure the AVR does not interfere with the RX and TX lines. <A> The Arduino has only one UART, so it can't act as a bridge between the computer and the Blu-Ray. <S> I don't speak Polish, but from what I can tell on the site you'll have a lot more luck just using an FTDI USB->serial cable and connecting to the header. <S> I recommend the TTL-232RG-VIP-WE from FTDI, found here: http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm <S> This is a wire-ended cable, so you'll need to attach some sort of header to it to be able to interface physically to the Blu-Ray, and you'll also need a connection to VCC and ground (so the cable can detect the proper voltage levels). <S> Then you just have to make sure that the computer's RX is connected to the Blu-Ray player's TX and <S> the Blu-Ray player's RX is connected to the computer's RX. <S> Then use a serial terminal program to connect and go crazy. <A> I connected my Arduino board (without AVR chip) to my router without hassle. <S> Arduino works at 5V (USB ofc) and router 3.3V. <S> It works with no problem whatsoever, I just connected TX, RX and GND (no VCC) <S> Oh, router model is WR741ND v4.3 <A> Better way would be to buy a USB to serial converter from ebay for less than $3. <A> On mega2560 you can ground reset and bypass avr and use arduino as bridge
Yes, You may use a proper Arduino as an expensive USB to serial converter.
How to limit inrush current? I'm designing a device powered from USB. The device uses FTDI FT2232 chip for USB connection. Upon a command from a computer FT2232 chip should enable power via a MOSFET switch to rest of the circuit. This additional circuit has a capacitance of 50uF (FPGA + aux stuff) and is powered from the same USB port. After the switch is turned on, this additional 50uF capacitance will sink a huge current until it's charged. How to limit this inrush current 1) to avoid voltage drop on power rails and 2) to avoid USB PTC from disconnecting power to the device? Is it enough to put a ferrite bead in series with MOSFET switch to limit the inrush current? Or should I use a special chips, like chips for limiting current or chips for slew rate control? Note: all devices are powered from 3.3V. So a small drop on 5V rail should not be a problem if it does not prevent an LDO to output stable 3.3V. <Q> Use an RC circuit in the MOSFET gate to slow down the turn-on. <S> One of the FTDI app notes has this example of a soft-start circuit on USB Vbus: <A> The USB specification chapter 11, Interoperability and Power Delivery, places rather stringent limits on power draw. <S> The cited capacitance there is only 10µF, to avoid too much voltage drop. <S> A brown-out detector may be enough, but a few devices require many voltages in specific orders. <A> The other answers are good but if you prefer a one component solution there exists Inrush Current Limiters. <S> I've used them before to prevent fuses blowing when hot-plugging the power supply. <S> Their operation is really simple. <S> Basically they have a resistance at room temperature, say 5Ω. When you plug in a 5V power source <S> the surge current is now limited to 1A even if there is a direct short on the other side of the ICL. <S> (5V/5Ω = 1A) <S> As soon as current flows through the ICL <S> it starts to warm up and its resistance then drops very close to 0Ω (check the datasheet) and <S> it's like the component is no longer in the circuit. <S> I like these because they're usually easy to rework into an existing designs and it's only one component.
There are specialized ICs (like LM3525 ) to do both current limiting and power switching, which might help, but make sure the circuitry behind it handles the slow voltage rise correctly.
Is there some logic in IC name prefixes? There are hundreds of prefixes in IC names, this page lists a number of them. For some it's easy to see that they refer to the manufacturer's name, like AD for Analog Devices or LT for Linear Technology. Others can be found with several manufacturers, often three letter prefixes: SAA , SAF , SDA , TCA and TDA , to name a few. I wonder if there's some logic in this, like T** being a specific group with subgroup TD* , etc. Is there a logical structure? <Q> As the number of IC available has continuously grown the complexity of the naming schemes have become less obvious, and more exceptions exist. <S> For example MAX- prefix typically refers to a Maxim IC, including the well-known MAX232 except MAX232 is also made by TI. <S> The NE5532 available from JRC , TI and On Semi, was originally designed by Signetics and continue to use the NE- prefix. <S> Other than business unit / company (original or acquired), the next most popular prefix convention would be series or technology based. <S> Here I'm thinking of Op-Amps such as TL-, which are JFET or BiFET based op-amp technology <S> AFAIK . <S> Of course there are nearly as many exceptions to the rule as the rule covers, so like life, it's messy. <A> Of course not! <S> Obviously in some cases a subsidiary may start with the same first name but in general there is no logic to it. <A> I checked a number of TDA devices here <S> and they all seem to be for audio/video applications. <S> Most (not all) analog. <A> There really is a logic in it, but its determined by each manufacturer (unless it is a second source).There are some organizations (JEDEC, EIA, PRO-ELECTRON) <S> who tried more or less successfully <S> (I believe it more to the less side) to standardize this issue. <S> Anyway, in the cited example (T and S-something) resembles a european standard managed by PRO-ELECTRON.Further information see following link http://en.wikipedia.org/wiki/Pro_Electron <S> It is also helpful consult manufacturer's databooks (major ones are on-line). <A> Whether it's usable or not is a different question entirely. <S> The problem is that it's only rarely standardized across manufacturers, only occasionally standardized across departments in one department, and only sometimes publicized. <S> About the best you can do is look up the datasheet and hope it includes information about what the various sections of the part number mean. <S> For instance, many microcontrollers have several options for peripheral sets, memory sizes, packages, temperature grades, etc., and you can specify these options by building a part number. <S> The prefix, however, usually has only one option. <S> I suppose you could construct a list, but I'm not aware of any standardized format or universal list.
Manufacturers often do use their own prefix for original products, or may continue to use a prefix of a company or product line that was acquired. There is some logic to the prefixes.
Combining and Charging multiple Lithium Ion Battery Cells (3.6 V or 3.7 Volts) 1] Voltage: 3.6V or 3.7V Are all 18650 lithium ion battery cells 3.6 or 3.7 voltsor or are there different voltage Lithium Ion cells in the market as well? 2] Possible Voltage Shortage? Do all 3.6/3.7V li ions work the same standard way with a + a - and a T or do they really differ? What does the T stand for? Temperature sensor? 3] Physics Voltage Reason Whats the reason for the 3.6/3.7 Volts per Li Ion Cell? I never saw a 3.0V or 5 Volts... Curious... 4] Parallel Charging of many Li Ion Cells I was thinking of putting two or four of those Panasonic/Sanyo 18650 Li Ion cells in parallel, soldering together from the instant the are new, that way giving me lots of mAhs. Can I use the same Li Ion charger that was made for charging just 1 cell, and let it be in the charger for longer time? 5] Charging Wiring... How? I found a nice small cheap charger about 30~40$ called Turnigy Accucel-6 (there is also an Accucel-8 for double price and double weight). Could I attach the + to + of all the cells and the - to all the - poles of the cells without needing any extra in-between-wiring? <Q> Well, actually I was also interested here. <S> LiIon batteries have lots of variants of chimestry - all are LiIon, but different voltages, prices, reliability. <S> LiCoO2 <S> 3.7 V 140 mA·h/g 0.518 <S> kW·h/ <S> kgLiMn2O4 <S> 4.0 V 100 mA·h/g 0.400 kW·h/kgLiNiO2 3.5 V 180 mA·h/g 0.630 <S> kW·h <S> /kgLiFePO4 <S> 3.3 V <S> 150 mA·h/g 0.495 <S> kW·h/kgLi2FePO4F <S> 3.6 <S> V <S> 115 mA·h/g 0.414 <S> kW·h/kgLiCo1/3Ni1/3Mn1/3O2 <S> 3.6 <S> V 160 mA·h/g 0.576 <S> kW·h/kgLi(LiaNixMnyCoz)O2 <S> 4.2 V 220 mA·h/g 0.920 <S> kW·h/kg <S> http://en.wikipedia.org/wiki/Lithium-ion_battery#Positive_electrodes <A> 1] <S> VOLTAGE: 3.6V or 3.7V - 18650 <S> Li Ion Batteries <S> All single cell lithium ion batteries are going to be 3.6-3.7v. <S> There are applications where multiple cells will be tied together in series. <S> This will result in voltages that are multiples of 3.6-3.7v. <S> 2] <S> Possible Voltage Shortage? <S> The voltages and battery life responses for all batteries are going to have slight difference. <S> For the most part this won't matter. <S> Most projects that use batteries are not terribly voltage dependent. <S> They will either boost or regulate their voltage to get the voltage they want out, or they will be able to run at a wide range. <S> As a note, "Shortage" in this context usually means you are creating a short across your battery. <S> Might want to be careful with that terminology. <S> 3] <S> Fundamental Reason for this Voltage Range <S> I am not an expert on this, but <S> I know it deals with the chemistry of the battery itself. <S> 4] <S> Parallel Cell Charging - One BIG Li-Ion Battery Pack <S> This can be done. <S> There are some issues that can come up when doing it. <S> This might be worthy of a question by itself. <S> If you do ask, might want to ask if the same can be done for packs in series. <S> 5] <S> Charging... <S> How? <S> Same as previous answer. <A> LI-Ion batteries are left with a charge of about 40% when they leave their factory. <S> The discharge under storage is best then. <S> This results in a voltage of about 3.7 for most types. <S> When fully loaded or 100% charge the voltage is about 4.1V to 4.2V <S> Do not charge them higher or they will lose their lifetime. <S> They can be discharged until 3.3V or even lower but again lifetime is shortened when discharged too much. <S> I have much experience in charging an discharging as i am using solar cells to charge my li-ion batteries. <S> I use for charging my mobile phone(s) <A> It can in fact be very important! <S> The charging voltage of a 3.7V LiPo or LiIon is 4.2V, but for a 3.6V one it is only 4.1V! <S> You could easily damage a 3.6V LiIon cell by charging it to 4.2V. <A> I doubt if you will see any difference between one delivering 3.6V and one delivering 3.7V, in practice, as there are many other factors involved. <A> most of the devices are not that sensitive to voltage. <S> but when they tied up in a series that results in a big voltage difference and this difference is directly proportional to number of cells you tied in series. <S> If your series contains 2-3 cells thats fine if you go beyond 5-10 cells that results in around 1V difference that matters for sensitive devices such as loptops. <S> gave a good one
The nominal voltage of Li-ion cells is 3.6V-3.7V, depending on the manufacturing technique. Rated voltage might be rated different to make it serve more in expense of capacity. So as long as you match the number of cells and approximate mAH you should be fine.
How to measure Voltage & Current with a single multimeter, Simultaneously? I have bought a cheap but neat Uni-T UT61E multimeter, which only has one display as most multimeters. For 40 Euro's I cant complain. It's on the way to me. Q.1 If I would like to measure both Voltage and Current, do I have to buy another multimeter? Are there mutlimeters that measure both Voltage and Current in two displays with multiple wires attached to the meter? Have searched but haven't found any hand-multimeter. Q.2 I would like to put a very tiny voltage/current multimeter lcd on my batery pack so that I can check the volage there (without using my big multimeters) on travels. Any advice on how/where I can find such things?So far I only found this which is a self-build kit: Do you have better advice and/or know any existing final products that are calibrated and working okay? http://www.electronics-diy.com/store.php?sel=kits&sub=pic_voltmeters My new big mutlimeter on its way, with which I guesse I cant view voltage and current simultaneously: <Q> Q1. <S> In most cases you can measure a fixed battery voltage and continue to assume that voltage while measuring current. <S> Or, you can buy a meter with a dual display, but those typically aren't cheap. <S> Most dual display meters though can't do everything you need - for example, they can only measure voltage and frequency at the same time. <S> I'd suggest what you do instead is keep the nice meter for accurately measuring most things but buy one of the cheapie Mastech £3 meters to measure the second quantity. <S> They actually do pretty well, most within 0.5% accuracy. <S> And it's no big deal if you damage one. <S> Q2. <S> I've heard good reviews from this one , designed for model aircraft. <A> A typical multimeter has no support for that. <S> To do accurate power measurements, your best bet is to use 2 multimeters at the same time. <S> If you use 1 multimeter and swap V/I in 2 tests, you may get a little error due to the internal resistance of the multimeter in the Amp range. <S> That might lower the voltage on your load, which may increase current depending on the type of load (switching supplies draw more current with lower input voltages). <A> You do not need to measure voltage and current in Your loader simultaneously. <S> They do not change rapidly in Your loader/battery set. <S> You can simply measure Voltage, then current. <S> By me, it is better to buy good quality Charger and batteries, than carrying multimeter with You. <A> I often just use two or more multi meters to measure voltage and current simultaneously. <S> I just note the results down by hand periodically, and calculate a rough figure for power draw over time. <S> For more professional purposes, you can get data logging equipment such as Trendeca that can simultaneously log voltage, current, and a whole host of other parameters. <S> This type of equipment is expensive, but produces better results than I can get by hand.
To anwer your first question: If you want to measure both current and voltage at the same time, you're doing a power measurement. They do exist, but they are (much) more expensive .
How to remove "glue block" from PCB? I have a mysterious component covered with yellow "glue" or something. It has very hard surface, but it seems its been poured into the plastic "cage". The shiny cover on the top is some kind of paper, I can rip it off. Any idea how to remove this goo from the PCB? (Without damaging the components underneath) <Q> That's a potted circuit. <S> The shiny paper on top likely forms some sort of EMI shield to reduce interference it may cause or receive. <S> Potting is usually an epoxy, which usually cannot be removed either chemically (dissolution) or thermally (melting it), so you are left with mechanical (chip away at it). <S> Some are soft, and while they stick fairly well, with a bit of time can be removed. <S> Some rare epoxies are susceptible to attack by extremely aggressive organic solvents (dichloromethane, xylene, etc.), but you may well destroy the board in attempt to remove it. <A> I don't know what that glue is, but I would try: Acetone (nail polish remover) <S> Pliers (pull/chip it off) Hot air (melt it) <S> Alcohol <S> Here are some suggestions from another thread: http://science.niuz.biz/solvent-t45294.html <A> Red fuming nitric acid is used to dissolve the epoxy resin used in chip packaging, and might work. <S> It's dangerous stuff, though, and will probably dissolve the epoxy used in the PCB.
If you have access to some chemicals and can chip off small samples of the epoxy, you could give it a whirl. If it's a hard variant, it may well be impossible, and if you really want to figure out what's under there, using an X-ray inspection machine would be a good idea.
Microcontrollers: Can I perform floating point operations in a Picoblaze controller? I wonder if I could perform floating point operations in a Picoblaze controller? Thank you to all posible answers with direct references to documentation or articles. <Q> If it does, you can do it in hardware. <S> Otherwise, you will need to do it in software emulation mode. <S> Since I noticed that you asked the same question for both the Picoblaze and the Microblaze, maybe you need to ask yourself why you need to do floating-point operations. <S> In many cases, there are alternatives to floating-point operations. <S> Fixed-point operations are a common alternative to floating point. <S> You will need to study your algorithms to determine if it is possible to represent the values in a fixed-point math alternative to floating-point math. <S> For example, if you use an 4-bit fixed-point width, you can represent values in quantums of 0.125 between -1.0 to 0.875 with fixed-point representation. <S> Larger values can be scalar multiples of these values. <S> Edit : <S> Article explaining float-to-fixed-point conversion. <A> Picoblaze does not have floating point support. <S> The supported instruction set is very limited, but useful for simple applications. <S> However, if you require floating point support, it is possible to develop your own interface between picoblaze and a Xilinx Floating Point Core (or other logic). <S> In this situation, you could write data out to the core, and read the result back. <S> I have no idea <S> what your performance requirements are... <S> you would have to consider the communication overhead. <S> As previously mentioned, MicroBlaze has hardware single precision FPU, and can handle double precision operations with software emulation. <S> The Picoblaze documentation is very good and can be found here . <S> Additionally, check out the Xilinx User Forums which has support related to Picoblaze and Microblaze. <A> You can do floating point in Picoblaze, but if you try IEEE754 <S> it'll be very slow <S> : it's an 8-bit processor trying to do operations on 32-bit or 64-bit data types. <S> hard work: nothing's written ready for you to use, so you'll have to do it all yourself potentially impossible as the amount of code required is probably more than Picoblaze can address <S> Depending on your requirements, you could possibly come up with a custom "small floating point", maybe 2 bytes wide with a 4 bit exponent and 12 bit significand? <S> You'd still have to write your own arithmetic code for it though. <S> If you must use Picoblaze, fixed-point is going to "fit" it much better. <S> To be honest though Picoblaze is a weird choice for anything math-related as it doesn't even have a hardware multiplier! <S> Maybe fall back a step and describe the problem you think you can solve with Picoblaze ( <S> as you mention System Generator in another comment, there may be a better way using the tools available)
Unfortunately, I do not think that the Picoblaze has hardware support for floating-point.
Inexpensive switching regulator with internal inductor & diode I'm trying to minimize part count and cost of my project. It needs to have a 6V power rail with about 1.5A peak current from a 12V input. I'm shying away from a linear regulator because of the power dissipation but I would like to keep cost and part count down. Do switching regulators exist with internal diode and inductor to match these parameters or would it be less expensive to have a linear regulator with a big heatsink? <Q> lowest cost, lowest part count. <S> Pick one. <S> A seach for Integrated switching regulators will find some of them. <A> You won't find an integrated inductor for these specs <S> and I doubt they exist for smaller currents. <S> You'll need something in the order of 33-100uH and at >1A this is huge from an integration point of view. <S> Synchronous switchers use a MOSFET instead of the Schottky diode, and that's often integrated. <S> They also have higher efficiencies. <S> Have a look at National's Simple Switcher series, which includes parts like LM22676 which require minimal external components and provide high efficiency (for the LM22676 >90%). <S> National has an online Webench design tool to help you select the right components. <A> There are also plenty switching controllers which would need an external FET. <S> There are some regulaturs with an internal diode, but not plenty. <S> I haven't seen internal inductor. <S> Typical required inductors are well pretty large. <S> I don't think they will be able to fit on the die of a chip. <S> If you're seeking for a way to decrease the size of the power supply, try using a more faster switching regulator. <S> They are a bit harder to work with (in terms of PCB design and such), but require smaller inductance values and thus smaller inductors (in a smaller package).
There are many ready-made SMPS modules - some even have the same footprint as 78xx regulators. Most switching regulators have got an internal switch.
Understanding the IR Emitter / Detector I pulled off of an inkjet printer Long Story Short It's a "linear/rotary optical encoder," or, "incremental encoder," like this one, which costs about \$6: http://www.mouser.com/Search/ProductDetail.aspx?R=AEDS-9641-P10virtualkey63050000virtualkey630-AEDS-9641-P10 You use it with "optical encoder strips," or "codestrips," like this one, which costs about \$.30: http://www.goldmine-elec-products.com/prodinfo.asp?number=G15602 It uses a single LED with 2 photodetectors. These are exposed as pins labeled Channel A and Channel B. The pins will output either 0 or Vcc V, which is 5V in my case. Since there are 4 distinct states for A and B, you get 4 times the resolution of your codestrip. Since it can handle up to 150 lines per inch on a codestrip, you get 1 600th of an inch resolution. When monitoring the A and B channels, you can determine which direction you are moving by comparing your current state to your last state. For example if A and B are both high, and then A goes low, you've moved up 1 600th of an inch. It is a great, accurate, affordable system for determining precise linear position. Original Post The red arrow points to the ir emitter / detector. The blue arrow points to where I got it. The printed circuit board under the blue arrow would slide back and forth under that gray band, which is transparent plastic with lots and lots of very skinny black lines. That was probably how the inkjet printer kept track of the position of the print head. The 2 ir diode pins were easy enough to figure out. That's being powered by the fat white wire on the far left. I can't figure out the additional 4 pins on the detector part though. Notice, that's a total of 6 pins. I pulled the cover off the part to get a closer look, and those pins look like this, with the skinny white wire attached to the pin on the far right: The black cover on the ir e/d has tiny white letters: 9981C526 and tiny black letters Agilent18 I tried Googling around for datasheets, but I didn't manage to find anything. I tried calling Agilent but just got lost in the phone tree, and they hung up on me at some point, haha. Does anybody have a datasheet for this or a similar component, or have any idea how this 4 pin detector works, or know where to look for a datasheet or who to call, or know a component I could substitute, or anything really? This is all part of a bigger thing I'm trying to get a handle on, which is precise 1 dimensional movement, and then ultimately precise 2 dimensional movement. Edit To be clear, there are 6 pins total. 2 for the diode, and 4 for the detector. I don't understand what all 4 pins on just the detector are for. Edit 2 I found a very promising blog post about this kind of problem. http://benkrasnow.blogspot.com/2010/02/linear-position-tracking-with.html Here's a 6 pin linear optical encoder with data sheet which I found from this blog post. http://www.mouser.com/Search/ProductDetail.aspx?R=AEDS-9641-P10virtualkey63050000virtualkey630-AEDS-9641-P10 <Q> I believe your part is a dual channel IR position sensor. <S> I can't find your exact part, but I did find a datasheet for something very similar <S> although this has 8 pins, this is the OPB822: <S> However, yours only has 6 pins. <S> I guess that as you suggest, two pins are the infrared LED, so I think that the two detectors share the same LED. <S> The other four pins are the opto couplers, and you can identify them using an multimeter that can measure the voltage drop of a diode. <S> The dual sensors can then be used to sense which direction its travelling along the strip, and how far. <A> Similar products are simply an IR LED + phototransistor. <S> That makes for the 4 leads. <S> Look for a diode with a multimeter, polarize it, and you should get the other 2 pins to conduct. <A> In case anyone else stumbles upon this IC, <S> I also just happened to find one of these in an old printer. <S> After some research, i found this datasheet: http://www.datasheetarchive.com/AEDS-9620-datasheet.html , which is pin-compatible and looks pretty much the same as the component in question. <S> I tried hooking it up as described in the datasheet <S> and it turns out to be working. <S> I Used a 220 Ohm resistor at 5V for the emitter, and the two outputs show very nice square-waves when the sensor is slid along the printer's code strip.
Try touching two of the probes to two of the pins while switching the transmitter LED on and off, if the reading changes with the LED, then you've found two of the pins you need.