Loading...
  Show Posts
Pages: 1 ... 39 40 [41] 42 43 ... 52
601  Using Arduino / General Electronics / Re: want to build my own power supply with pot ajustments on: March 15, 2012, 05:39:54 pm
Page 17 of the LM317 datasheet shows a "high current regulator" using some additional transistors. 


When you get up around 3 Amps I'd say it's time to start thinking about a switching regulator.  A switching regulator is much-more efficient and can put-out high-power without dissipating lots of power/heat inside the regulator itself.  (Efficiency is more important in a variable-voltage design where the voltage "dropped" across the regulator can be higher than a fixed-output design.)


Off-hand, I don't know of any variable-switching power supply chips, but I'm sure you can find something, or someone else can suggest something.
602  Using Arduino / Programming Questions / Re: Random function on: March 15, 2012, 04:10:37 pm
You generally seed the random number once (outside of the loop). But, that shouldn't be causing you a problem since you are seeding the random generate with a diferent value each time.

I agree that it makes more sense to randomly choose the HIGH/LOW (1/0) state randomly, rather than choosing the pins randomly. 

I don't think you need a random number for the pin at all...  You can simply write random data to ALL of the pins/LEDs every time through the loop, to pop-up a random pattern each time through the loop (if that's what your're trying to do).     

Unless, you wanted to change only one pin each time through the loop.  Then, you might want to randomly choose the one-pin to be "active" each time.   If you do that, you'll  only get a change about half the time, randomly... smiley-wink 

P.S.
I dont know what your goal is, but once you get this working you might want to make one more enhancement...

Since there are 8 different possible "patterns", you are going to get a "repeat" about once per second (randomly)... i.e.  you'll get the same pattern twice in a row...  so on-average, you'll only get about 9 "changes" per second (instead of the expected 10), and it's going to "look like" a glitch or a pause.  If that's a problem, you might want to look for that and skip the delay if you get the same pattern twice in a row.

If there are any other "invalid" states like all-on, or all-off, you can check for that too, and start the loop over if you get something invalid.
603  Using Arduino / Audio / Re: arduino + siren on: March 15, 2012, 02:10:56 pm
I see the picture, but I don't see any specs... Is that a speaker or a siren?

smiley-sad You can't drive a speaker or a siren directly from the Arduino or a 555.  You need to boost the voltage/current.

If it's a siren, you don't need the 555.   You hook it up to 12VDC (I assume it runs off 12V?) and it makes noise.   (Do NOT connect a speaker to 12V!)   In that case, you need a MOSFET or transistor (and a 12V power source) to go between the Arduino and the siren.

If it's a speaker, it typically needs a power amplifier between the 555 sound generator and the speaker. (There are lots of power amp chips available.)  Or, in this application you don't really need a clean-linear, non-distorted, audio amp, and you can use a MOSFEET (or two) in non-linear "switching" mode.

P.S.
You should be able to generate siren-like sounds without the 555s by using the tone() function.    (Of course, you'll still need to boost the signal to drive a speaker...)
604  Using Arduino / Project Guidance / Re: How do I change the code to do the opposite? (conductive paint) on: March 15, 2012, 01:24:50 pm
I'm just going to make a guess...

Old code:
Code:
// check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn speaker on:   
    digitalWrite(speakerPin, HIGH); 

Try changing the condition from HIGH to LOW...
Code:
// check if the pushbutton is pressed.
  // if it is, the buttonState is LOW:
  if (buttonState == LOW) {     
    // turn speaker on:   
    digitalWrite(speakerPin, HIGH); 

605  Using Arduino / Project Guidance / Re: Can ATtiny45 be used for this application? on: March 15, 2012, 12:58:54 pm
I'm going to say...  probably... smiley-grin

But, if you are using a Duemillanove (or Uno), what's the ATtiny45 for?

Quote
One of my friends said it might have some problems with "interrupt" or something. I am not really so keen on microcontrolers.
Probably right...

A microprocessor/microcontroller can only do one thing at a time.*  So in your case, it needs to switch between timing the wheel rotations and updating a display (or sending out PWM, or whatever).   

If it's updating the display when the wheel sensor gets triggered, you need to interrupt the display process (for perhaps several microseconds) and "grab" the time before too much time goes by and the timing/speed gets fouled-up.

Quote
The idea is to mount several magnets...
I think it's "traditional' to trigger once per revolution.  The more magnets you use, the more chance there is for a problem.  Maybe go with two if you want to keep the wheel perfectly balanced.    If you have 10 magnets, and one gets knocked out of position or fails for some reason, you'll be off 10% and you may never know...   More readings isn't going to make it more accurate.  It's just going to give you more data/readings.   How many times per wheel revolution can you read the speed display? smiley-grin   For the microprocessor & firmware, it's no problem...   Several triggers per revolution is s-l-o-w for the processor.

Quote
...for a Schmidt trigger on the rear hub.
You're going to need a hall-effect sensor too. smiley-wink



* Your computer is multitasking all of the time, even when you're only running one application.   It's constantly updating the display and monitoring/updating the mouse, and a bunch of other stuff, etc.  But, (assuming a single core) it's really only doing one thing at a time, rapidly switching between tasks and handling interrupts.   



606  Using Arduino / General Electronics / Re: Pull Up / Pull Down / Wired OR on: March 14, 2012, 07:47:11 pm
I'm new to the Arduino, and i don't understand what the pin-13 connection (through a capacitor) is doing... The reset circuit is already ORed (actually NORed) with the reset button.

Quote
Connecting pin-13 being high to RESET would probably inhibit a reset...
Yeah, and if you make a hard connection to +5V (no resistor) pressing the reset button will short 5V to ground.

Removing the capacitor (C5) will break all connection between pin-13 and reset.  Someone else will have to jump-in and explain the effects/consequences.

Quote
Can I break something by eperimenting, short cutting etc.
Shorting is generally dangerous. (Dangerous to the parts... not dangerous to you... smiley-wink )   You can get excess current and burn-out parts.   Often, you can get-away with  things you should never do, like accidently shorting an output to power or ground, but you can blow the chip so you shouldn't try it.  (Shorting the reset to ground won't "damage" anything...  You'll just get a permanent reset condition. smiley-grin ) Cutting traces and opening circuits is generally safe.   "Randomly" connecting-up capacitors or higher value resistors shouldn't damage anything.    I'd say a 10K resistor connected anywhere on the board very-unlikely to damage anything.   I'd be "careful" with values less than 1K.
607  Using Arduino / General Electronics / Re: Converting 5V to 240V on: March 14, 2012, 07:10:28 pm
OK...  You don't need to "convert" the voltage.  As you said, you need to control the higher voltage. You also need to isolate the high voltage from you low-voltage circuit (for safety).

1.  Since you are new to electronics, the simplest solution is a solid state relay (example).   Most solid state relays will work directly from the low-voltage low-current Arduino outputs.

2.  There are a few mechanical relays that can work at 5V at less than 40mA, but most require slightly more voltage & current to "activate" the coil.  So, most regular (mechanical) relays will require a transistor or MOSFET driving the relay coil.    This assembly has some electronics and some relays and is "ready to go".

3.With a TRIAC and a special opto-isolator designed to drive a TRIAC, you can essentially build your own solid-state relay.  I've done that before, and that's probably how I'd do it again.)
608  Using Arduino / Project Guidance / Re: Need to design a circuit that lets me limit current between 0 and 2mA on: March 14, 2012, 06:23:38 pm
I've never used an LM334...  The spec sheet it goes down to 1uA and there might be a "trick" for changing it's range.

I think you should be able to build a transconductance amplifier (a voltage-to-current converter) with an op-amp.  I've never built one of those either, but I assume, like most op-amp circuits, if you choose the resistors correctly you could build something that puts-out 2mA with 2V in... Or 2mA out with 5V in.   That should give you plenty of resolution.

Or, National makes a transconductance chip, the LM13700, and it might be worth checking-out.
609  Using Arduino / General Electronics / Re: 7805 voltage regulator powering arduino on: March 14, 2012, 04:53:11 pm
Quote
I think I will search for an alternative...
If the wasted 3/4ths of a Watt are a problem, I can think of two solutions -

1. Lower voltage into the regulator.  If you built the power supply yourself, changing to a 6VAC transformer will give you about 9VDC after rectification and filtering.   That will bring your efficiency from ~25% to ~50%.

2. A switching regulator is more complicated to build, but it can be ~90% efficient.

If you were running off a battery, the wasted energy will reduce battery life.  But in most applications, the wasted energy is not a problem, especially if you are running off of "wall power".    With appliances, heating, and lighting consuming thousands of watts, an additional watt is not going to add anything measurable to your electric bill.    In the winter it essentially adds nothing since any heat generated subtracts from the heat needed from you furnace.  (Except electric heating is usually more costly than gas or oil.)    The same is true in an automotive application.   You are not going to notice any loss of power or any loss of gas mileage with an additional one-Watt load on the engine.  Your car lights are over 100W total, and you don't notice any difference in performance when driving at night...
610  Using Arduino / General Electronics / Re: Reading a frequency with an Arduino on: March 14, 2012, 02:58:32 pm
That shouldn't be too hard.  What's the frequency range?

If you have a nice clean "digital" square wave that goes between zero and 5V.  All you have to do is check the time (microseconds) when the input goes positive (or low), and check it again when the input goes positive (or low) again.   Subtract for the period (the time for one cycle) and invert to get frequency (microseconds -> megahertz, etc.). 

This is probably a case where interrupts are appropriate.  (Trigger an interrupt when the input goes high (or low).

For better performance, you'll want to take several readings and calculate an average.
611  Using Arduino / General Electronics / Re: voltage and power ajusting on: March 14, 2012, 01:15:09 pm
You should probably be looking at a switching design.   A linear regulator (like the LM317) is easy to use, but it has to dissipate the "extra" power in the form of heat. 

If you put 10V into a 5V linear regulator, the voltage is divided so both regulator & load both see 5V.  And and since they they both pass the same current, the regulator and the load dissipate the same power.  (Half the total power is wasted as heat in the regulator.)  If you put more than 10V into that regulator, the regulator is wasting more power than is going to the load.

With a switching regulator, the "device" switches on & off (very-much like the Arduino's PWM outputs) so it doesn't "see" voltage and current at the same time and it dissipates (relatively) very little power/heat. 

If you increase the voltage into a switching regulator, the current into the regulator will decrease although the current into the load remains constant.     Since switching regulators are around 90% effecient, you typically get more current out of the regulator than you put in!   (Less voltage, of course.)
612  Using Arduino / General Electronics / Re: 250k, 500k and 1meg digital pots on: March 14, 2012, 12:56:02 pm
If you live in the U.S. it looks like Digi-Key has selection.   Or, you could probably re-design you circuit to use a different value, or possibly re-design the circuit to use something other than a digital pot.
613  Using Arduino / Project Guidance / Re: Can I be a embeded programmer? on: March 14, 2012, 12:43:51 pm
Like a lot of things, it's probably 90% "getting in the door".   If you've got a job as a Java/C++ programmer, you might be able to get transfered to an embedded project.   Or, if you work for a small company, you might be able to do some system-level programming and some lower-level embedded programming.

Look-up some job openings and see what the requirements are....

In order to get hired straight out of college, you'd need lots of hardware knowledge.   I suspect that lots of embedded programmers actually have an EE degree with a strong programming background.  (It looks like my old college has embedded courses offered by both the EE and CS departments.)

Quote
I was very bad in electronic subject in University.
You need to understand digital electronics.   You need to understand how basic logic gates work (and-gates, or-gates, flip-flops, shift registers, etc.)   You should know something about how PLDs work.

You should understand what the address & data lines on a memory chip do, as well as the other control lines.   If the hardware engineer tells you, "The RAM chip-select never goes low", or "Data line 3 looks like it's shorted to ground", you've got to understand what he's talking about.

If you are working on a new design, you are working on non-debugged hardware and non-debugged software.   You can't just say, "That's a hardware probem."  You have to write the code to prove it's a hardware problem and you have to write the code to help track-down the hardware problem.

You need to understand the machine/assembly code for the processor you are working on.

You should know how to use an oscilloscope and logic analyzer.   A lot of times, you'd be working with a hardware engineer, but you've got to understand what he's doing and what you are seeing on a 'scope or analyzer.

You should be able to understand the datasheet for a microcontroller/microprocessor as well as the various peripheral/support chips.  Have you looked at the ATmega datasheet?  It's  400 pages!  If you are not intimidated by the datasheet, tha't's a good start.  You've got to understand what's going-on inside the chips and how the various chips are communicating.

614  Using Arduino / Project Guidance / Re: large drum-bot on: March 13, 2012, 08:04:20 pm
Pneumatic actuators are probably the most economical solution, especially if you already have a compressor.  But, they can be clunky/noisy, and difficult to "control".   You can control the speed to some extent by regulating air pressure, but otherwise it's just "move" and "move back".    I imagine you could use some feedback to get servo-like control, but I don't think there's anything like that available off-the-shelf.

I don't know if it's still done the same way, but "100 years ago" when I worked for the company, the characters/robots at Chuck E. Cheese were pneumatically operated.  If there's a Chuck E. Cheese near you, you might check it out.  (If they still have those animated characters, and if they are still pneumatically operated, you should be able to hear the actuators activating,)
615  Using Arduino / General Electronics / Re: Capacitor discharge unit for solenoid on: March 13, 2012, 06:50:52 pm
Quote
ok solenoid specs are 36v, takes in 2amps. any amendments?
Get (or build) a 36V/2A power supply and forget about the capacitors & "voltage multipliers".   That's 72 Watts!  You need to get 72 watts of power somewhere.

How big is yyour batttery?   Do you have a 72W battery?   If you are running off a car battery, you can get/build a power inverter to boost the voltage at that kind of current, but in that situation it makes a lot more (economic) sense to use a 12V solenoid.  And, it's not problem getting 72W (6 Amps @ 12V) form a car battery if you need a solenoid with that much power.
Pages: 1 ... 39 40 [41] 42 43 ... 52