Show Posts
Pages: 1 [2] 3 4 ... 86
16  Using Arduino / Project Guidance / Re: Convert pulsetrain into square wave. on: July 16, 2014, 12:39:33 pm
Maybe....  It depends on the characteristics of the pulse train and what "information" you need from it.

If you have a rectangle wave or pulse of a constant frequency, you can convert it to a perfect square wave of one-half the frequency by toggling your output-state on every rising-edge (or falling edge) of the rectangle wave.  That's traditionally done with a flip-flop.  You don't need a microcontroller on any programming.

If you have a serial data steam, you could detect the data-stream and generate a square wave, but of course the square wave wouldn't contain the serial data.
17  Using Arduino / General Electronics / Re: Are residential customers billed for Real or Apparent Power ? on: July 15, 2014, 02:41:07 pm
I believe a watt-hour meter measures true power

...but real power is well under 100mW.
I haven't analyzed the circuit, but I'm not sure I believe that.  What's the zener voltage?  What's C1?   220uF?  220pF? It's kinda funny you've got 1W resistors if you only expect to dissipate 100mW total.
18  Using Arduino / Project Guidance / Re: Using a switch & LED to drive input pin on: July 15, 2014, 01:29:05 pm
Is there a way to connect 5 volts in a circuit with the led and the magnetic switch then to the pin to turn on the relay.
Sure!  Wire the LED in series with a resistor (as usual).  Connect one end of the LED/resistor to +5V and the other end to the switch.  Ground the other switch contact.   Now when close the switch is closed (turned on), the LED will come on.

Also connect the non-grounded end of the switch to an Arduino input.    Enable the Arduino's internal pull-up resistor so make sure the input reads high when the switch is open.  When the switch is on (closed) , the Arduino input will be pulled low.  Your sketch can read the input state and take appropriate action.
19  Using Arduino / Project Guidance / Re: Ultrasonic audio amplifier. on: July 15, 2014, 01:10:31 pm
I doesn't get much simpler than an LM386.  Is the 386 really obsolete?   Are you having trouble finding it?

The biggest problem I see with that circuit is that it needs another 386 (or something similar) on the output to drive "normal everyday" dynamic headphones.
20  Using Arduino / Project Guidance / Re: Powering mulitple Adruinos (8 to 10) - Best Source for power on: July 15, 2014, 12:56:24 pm
One more thought....

If you are concerned with power efficiency, run the Arduino from a 5V switching supply.  The on-board regulator is linear and at 9V almost as much power is wasted in the regulator as the Arduino is using.    (At 10V, the regulator is consuming exactly the same amount of power as everything running from it!  i.e.  50% efficiency.) 

If you need 9V for something else you can use two power supplies or a dual power supply. 
21  Using Arduino / Project Guidance / Re: Powering mulitple Adruinos (8 to 10) - Best Source for power on: July 15, 2014, 12:35:07 pm
One power supply isn't necessarily more efficient than 10 power supplies.     And, if you use switching supplies (or one switching power supply) they are nearly 100% efficient.

You'll need to measure (or estimate) the current required for each Arduino in your particular application.   I don't know what the current requirement for the Arduino alone is, but I'm sure someone can tell you.   Thenyou'll ned to know the current requirements for the RF module and relays.   And, leave yourself some safety margin.    A power supply with extra current capability won't be any less efficient and it will be more reliable.

So, I am considering running a low voltage run along with the AC lines and tap each unit off this line.
If you can run wires in parallel with the AC line, you probably don't need 10 Arduino's. smiley-wink

BTW - And I'm not sure what you are doing,  but you can buy "home automation" systems such as  X-10  or Insteon.   I've got an X-10 controller/timer and 8 or 10 X-10 controlled lights & outlets.   The controller get's programmed by the computer and it turns-on my porch lights at sunset, etc.     And, I've got a couple of manual controllers, so I can press a button an turn on/of everything that's X-10 controlled.

 I've also got a "sunrise simulation" gizmo I built with a microcontroller that slowly fades-on the light with a "gentle beeper" that wakes me up in the morning.   That gizmo doesn't have it's own time-of-day clock, so it's plugged into the X-10.   (With the Insteon dimmers, you don't need the gizmo because you can actually dim-up in steps to simulate fading-on the light over several minutes.)

You can interface the Arduino with the X-10 protocol, but I've never tried it.
22  Using Arduino / General Electronics / Re: Grounding with shift register on: July 14, 2014, 05:24:26 pm
Sorry, I don't understand your question...

You need a resistor in series with each LED.   When components are wired in series, the same current flows through both components, but the voltage is divided among the series components.   i.e.  You might have 20mA through the led and resistor, and with 5V applied, you might have about 3V across the resistor and 2V across the LED.

It doesn't matter if the resistor is connected to the anode or cathode (assuming you've got a normal 2-pin, one-color,  LED).    With the LED and resistor connected in series, you can treat these as one component.     

The shift register doesn't have anodes or cathodes...  It has a logic output.  This particular part has "tri-state" outputs.  That means they can driven high (+5V) to "source" current, driven low (ground) to "sink" current, or essentially off or unconnected ("tri-stated").

23  Using Arduino / Project Guidance / Re: Using External ADC's on: July 14, 2014, 01:52:47 pm
10-bits counts 0-1023, which is 0.1 degree precision on a 0-100 degree C scale.  You'll be lucky if the analog part of your temperature sensor is that accurate/precise.

I am curious if it is possible to use multiple ADCs to one pin (such as 20)
It generally takes more than one pin to communicate serially.  But, the I2C bus can handle multiple devices.
24  Using Arduino / Audio / Re: Need help determining which speaker is louder on: July 13, 2014, 12:06:17 am
You need a sensitivity or "efficiency" rating.    For example this speaker (which I just selected randomly) is rated at 91dB @ 1 meter with 1 Watt.    If you double the power, you'll get 3 more dB.   

Most amplifiers are "constant voltage", which means the output-voltage doesn't change when you change the load impedance (as long as you stay within the specs).     This also means that if you use a 4-Ohm speaker instead of an 8-Ohm speaker, you'll get twice the current, and therefor twice the power, with 4-Ohms.     If the 4-Ohm speaker and the 8-Ohm speaker have equal sensitivity, the 4-Ohm speaker will be 3dB louder.
25  Using Arduino / General Electronics / Re: How to use POTs on Arduino without over heating? on: July 12, 2014, 11:52:38 pm
If the pots are wired correctly, they will NOT overheat and the adjustment won't affect the current or the heat.   Do you have a datasheet for the pots?   Do you have a multi-meter?

When wired correctly the voltage is applied across the full 10K at all times and the current will be 5V/10k = 0.5mA no matter the pot setting.

I have 4 pots I need to connect so would it be okay to put the 4 pots in parallel to 5 v and ground
Yes.  If they are wired correctly, they can all be wired in parallel between 5V an ground, with the center-taps all going to different Arduino analog inputs.

26  Using Arduino / General Electronics / Re: How to use Arduino relay? on: July 12, 2014, 06:09:58 pm
A relay is simply an electrically controlled switch.    You can look-up how an SPDT switch works, and you should be able to understand what the relay is doing.

The common and NO contacts are normally disconnected, or "off".   When you apply power to the relay coil, these two contacts are connected together ("closed" or "shorted").

The common and NC work the other way.   These two contacts are connected together ("on", "closed", "shorted") when the coil is not powered.   When the coil is powered, these contacts open-up.

The NO & NC contacts are never connected together.

The terminology & logic is reversed from a water faucet...   For a switch or relay, closed means the contacts are connected an current flows.   Open means the contacts are not connected (the circuit is broken) and current doesn't flow.

Depending on your application, you may not need to use all of the contacts.

Many relays have a clear plastic cover that you can see through.    I was just wiring-up this relay about an hour ago.   You can see the internal wiring and you can see the contacts opening & closing as the relay operates.  (It's not for an Arduino project.  This particular relay has a 12V coil, and you can't operate it directly from an Arduino.)

In my application, I'm using the common & NO contacts.  The NC contacts are not connected to anything.
27  Using Arduino / Project Guidance / Re: 3208 ADC help on: July 12, 2014, 01:06:04 pm
Are the readings proportional?   What happens when you feed-in zero volts?   What happens when you bypass the voltage divider and feed-in 4.7V?
28  Using Arduino / Project Guidance / Re: Christmas Lights to Music TIP31 on: July 11, 2014, 06:09:38 pm
For your safety and your Arduino's safety (and to protect your connected audio system), you need to isolate the power line voltage.   This can be done with a solid state relay (or a mechanical relay) or an opto-isolator.
29  Using Arduino / General Electronics / Re: base resistor for TIP120 on: July 11, 2014, 01:54:24 am
and i would still like to learn how to calculate it for other transistors.
Since the TIP120 is a Darlington pair, things are slightly different from a normal transistor, but the concepts are the same.   

It starts with the fact that a transistor is a current amplifier.   A typical transistor has a current gain (beta or hfe) of around 100,   There is a graph on the TIP120 datasheet showing that the minimum current gain is about 500.  When current is above 1 Amp, the current remains above 1000.    The current gain varies from transistor-to-transistor, so the datasheet usually just specifies the minimum.

If you need 2 Amps (collector-emitter current), you need 2/500 (4 milliamps) base-emitter current.   

Since you want to make darn-sure the transistor is switched fully-on, you can put more than that into the base.    When we do this we say the transistor is "saturated", and the collector-emitter current is NOT determined by the transistor's gain, but limited by the load resistance (per the voltage and Ohm's Law).

The next thing you need to know is that the voltage applied to the base resistor (typically 5V if you are using an Arduino) is divided between the resistor and the base-emitter junction (Kirchhoff's Law).    With a normal ransistor the base-emitter on-voltage is around 0.7V.    That means we have 4.3V across the resistor.  Since we are usually over-driving and saturating the transistor, we have a little voltage to "play with" and we can usually ignore the 0.7V drop and assume the full 5V is across the resistor. 

But, the Darlington has higher base-emitter voltage.   The datasheet says 2.5V, so we shouldn't ignore it and we should assume 2.5V across the base resistor.

You also need to know that the current through the base resistor is the same as the base-emitter current (Kirchhoff's Law).

Now that we know the voltage across the resistor and the required current, we can use Ohm's Law to calculate the resistance (V/I = R).   (In case you don't know, I is the symbol for current.)

Since we want to saturate the transistor, standard practice is to cut the calculated resistance in half (or more) to at  least double the base-emitter current compared to the calculation.

Another thing to know is if you change the load so it requires less current (say 1A or 1/2A instead of 2A), you don't have to change the base resistor...  The transistor will remain saturated.    But if change it to where you need more current, you may not have enough base-current to drive the transistor into saturation, and you may need to re-calculate.
30  Using Arduino / General Electronics / Re: Etched copper PCB question on: July 11, 2014, 01:05:47 am
I made a few homemade boards a long-long  time ago.    Personally, I don't ever plan on doing it again. smiley-grin   One of the nice things about the Arduino is that it comes on a PC board, so you don't have to make one for your microcontroller circuit (although you may need an additional board for your other circuitry).

I usually use breadboards in my permanent designs, or other techniques to avoid making PCBs.    I've got permanent-breadboard projects that I built about 20 years ago, and they are still working reliably.   One of them is an automotive project and the vibration hasn't caused any problems.   The downside to a breadboard is the larger size, and you need an adapter board if you want to use surface-mount components.

If I need a PCB, I plan on using one of the online services where you send them files and they ship you the  boards.    When I was in college, the electronics lab would make PC boards for a very reasonable fee if we supplied the artwork.    That was cool and I've never made a PCB at home since then.
Pages: 1 [2] 3 4 ... 86