Show Posts
Pages: 1 ... 39 40 [41] 42 43 ... 90
601  Using Arduino / Programming Questions / Re: Pulsing LED with varying speed keeps jumping brightness? on: May 09, 2013, 02:47:34 pm
I don't know if this is a problem, but you are passing a float ("out") to analogWrite().     You might try converting that to a byte or int first.   (And maybe check with the serial monitor to make sure you are getting the byte/integer conversion you are expecting.)
602  Using Arduino / General Electronics / Re: Door bell sensor? on: May 09, 2013, 12:56:54 pm
I'd try picking-up the electrical signal.   Most doorbells run off 12-18VAC.  Do you have a voltmeter?

There some issues, but these should be easy to deal with...   

 - Everyting is probably "floating", with no ground in the doorbell circuit.  You can simply connect the Arduion ground to one side of the dooorbell transformer's secondary.

 - You can't put AC into the Arduino, or voltages greater than 5V.   Besides the 12-18VAC, there is a high voltage inductive "kick" from the coil (assuming there's no diode across the coil).

A resistor and a pair of protection doides will take care of those issues.   For additional protection, you can add a voltage divider in front of that to knock the voltage down to 5V.    If you use a voltage divider, remember that the peal AC voltage is about 1.4 x the RMS value. 

However, I didn't have so far any "aha!" idea...  I was thinking in connecting the piezzo outputs to a 7805 so I could have 5V in the other end... but I don't even know if it would work...
No... Voltage regulators are for power supplies.

I think it's generally safe to connect a piezo directly to the Arduino.   They can put-out voltages higher than 5V, but they have very high internal impedance (low current capability) and the Arduino has small protection diodes built-in.
603  Using Arduino / Project Guidance / Re: Arduino Uno on AA batteries on: May 08, 2013, 05:54:07 pm
That should work fine...

I'd guess the connector might be wired backwards.    Typically the inside of the barrel-connector is positive (and that's what's needed for the Arduino), but there's no solid-rule and power supplies come both ways.

Do you have a multimeter?    ...Probably a good thing to have in your teaching-situation.    You can buy one online for around $20 USD. 

You can also make a little tester with an LED & resistor.  (The LED won't come-on if it's connected backwards, and you can compare the polarity of the battery with your regular power supply.)    I have a little tester I made with a probe (something like this), a couple of different-color LEDs (one for each direction) and an alligator clip.   But for a quick-and-dirty tester for your battery power-supply, you can just solder a resistor & LED in series.

Or you might simply have a bad solder connection, or the barrel-connector might be the wrong size.   (If it's the wrong size it would probably work when you wiggle it around.)
604  Using Arduino / Project Guidance / Re: Binary Down Counter on: May 08, 2013, 03:59:20 pm
How would I could a Binary Down Counter?
What does that mean?   Do you want to see ones & zeros on a display?   Do you want a string of 4 regular LEDs, with ones lit-up and zeros off?

The format only matters for input/output.   The compiler doesn't care and the & chip only uses binary internally.
605  Using Arduino / Project Guidance / Re: confused again with int byte char et al on: May 08, 2013, 02:02:56 pm
I have managed to combine the individual switch readings into 3  integer bytes, which I can display on the monitor fine ( along with a security code 4th byte )  for instance it says it sent    101 , 296, 03, 091
The value 296 (decimal) requires 9 bits and won't fit into a byte!

296 (decimal) = 1 0010 1000 (binary) = 128 (hexadecimal)

If you try putting 296 (decimal) into a byte, you loose the most significant bit -
40 decimal = 0010 1000 (binary) = 28 (hex)

I always have a problem with this,  how can you look at  56 for example, and know if it is number 56 or if its ascii  for 8 ?
It's all just ones & zeros...  Your application has to know what each byte represents.  It also needs to know if two bytes in a row are part of an integer or other-larger type.   In an EXE file, the byte(s) might represent a CPU instruction. 

With standard file formats (WAV, MP3, JPG, etc.), there is a defined file structure.  For example, in an 8-bit WAV file, each byte (after the header) represents an audio sample value.  In a 16-bit WAV file, a sample is represented by two bytes in a row.   The file-format specification and the file-header determine how the data has to be read.

You can open a file with a Hex editor to see all of the bytes.   Wherever there is a value that can be converted to an ASCII character, you will also see that ASCII character.    Usually, you'll see some readable text in the header.   When you get into the "real data", you'll also see characters.  For example, wherever there is a value of 41 hex (65 decimal) you will see 'A'.  But unless it's a text file, that 41 hex may not represent the letter A, and there's no way to tell unless you understand the file format.
606  Using Arduino / General Electronics / Re: About different ways of soldering on: May 07, 2013, 06:48:14 pm
I agree... Get a soldering iron.

I've never heard of tape-solder either.  I might have seen something like solder-ribbon that you wrap-around free-hanging wires before heating with a soldering-iron or torch.  Something like that might be appropriate if you are an auto mechanic???

I used conductive glue once to re-attach terminals to the rear-window defroster on my car...   For some reason the solder wouldn't "stick".   It's a fairly high-current application and the glue worked, so I assume the resistance was low, at least with that fairly-large surface area to work with.  (I was worried about resistance before I tried it, but I really didn't want to buy a new rear window.)

With surface mount, you may want to try solder paste and a hot plate.  But, I've never tried that myself...  I try to avoid surface-mount as much as possible at home.   At work we have a surface mount rework station that uses a pre-heater, a hot-air solder pencil, and solder paste...  Too costly for me at home, and it doesn't work that well with fine-pitch parts.  For board assembly, and for rework on fine-pitch surface-mount parts at work, we send the out board to our board-assembly house.  (Again, the setup costs for a board-asssembly contractor are way too high for hobbyists.  It only pays-off if you are building maybe 100 boards.)   
607  Using Arduino / LEDs and Multiplexing / Re: Dimming with AnalogRead/analogWrite-basic on: May 07, 2013, 06:21:40 pm
What I am trying to do is analogRead that value
What is "that value"?  I don't think you need analogRead()*...

You've got:   

int white_max = 100;  // Note - int must be lower case, not Int.

In that case, we (and your sketch) know white_max is 100, so if we want to set the brightness to 100, we have two choices:
analogWrite(white_leds, 100);  // The brightness is not variable.
Or since the variable white_max equals 100,
analogWrite(white_leds, white_max);     // Brightness = value of white_max

* analogRead gets the voltage from an analog pin and converts that voltage to a number between 0 and 1023, and (usually) you assign that value to a variable.    analogWrite() accepts values between 0 and 255.  That's why you divide by 4 when you dim an LED, based on an analog input voltage (from a pot, etc.).
608  Using Arduino / LEDs and Multiplexing / Re: Electromagnetic 7 segment on: May 07, 2013, 05:50:35 pm
Is there any manufacturer or part number?

Are there any electronics (a circuit board with IC's, resistors, transistors, etc.)?  Or just electromagnets?  Any voltage markings or anything?

If you don't have any information and there's no electronics, you can use a variable power supply (which you'll have to build or buy if you can't get your hands on one) to find out how much voltage it takes to change/activate a segment.  The when you find a voltage that seems to work, you can measure the current.
609  Using Arduino / General Electronics / Re: EMI Suppression bead on: May 07, 2013, 04:43:11 pm
Your computer is fried and you're worried about your Arduino????

I guess the lesson is to stick a USB hub between the Arduion and the PC...  Maybe I'd better get a hub!

I have a bad feeling your Arduino is dead...  You can check the inductor with an ohmmeter (multimeter).   It should read short (nearly zero ohms).     You might also check the fuse F1 while you're at it.  But that fuse and the bead only go to the USB port, so they shouldn't stop the CPU from running.

I'm assuming its something to do with the stepper driver thats killed eveything.
I assume so too...   Motors put-out an inductive "kick" (high voltage) when turned-off suddenly.   But, the motor driver should have protection diodes to prevent any damage (to the driver circuitry or the Arduino).

I assume the driver board runs off something like 12 or 24V?  Normally, the circuitry on the driver board should prevent damaging voltage/current from getting-to the Arduino.   But, if some semiconductor on the driver board fries and completely shorts-out, it's possible to get excessive voltage & current on the Arduino (depending on the driver design).  Then maybe your ATmega chip shorts-out, putting excessive voltage out the USB port, frying your motherboard...

If you are paranoid, you might try optical isolation between the Arduion and motor driver (at least during the experimental/development phase).

Or, maybe your motherboard, or computer power supply, failed first, putting excessive voltage out the USB port and frying your arduino....
610  Using Arduino / Project Guidance / Re: Sound Level Detector on: May 07, 2013, 02:30:45 pm
The brick includes a "high sensible microphone", but no amplifier, which isn't very "sensible".
This one does have a preamp.

I believe the output is also biased at 2.5V, which takes care of the negative-half of the waveform.  (You can damage the Arduino if you fed-in negative voltage, or voltage greater than +5V.)

You may need to subtract-out the bias from your ADC readings, and/or account for the fact that an AC signal has an average around zero...

smiley-grin I assume the SparkFun guys know the difference between "sensitivity" and "sensible"! smiley-grin
611  Using Arduino / Project Guidance / Re: Sound Level Detector on: May 07, 2013, 02:22:49 pm
...if a sound abnormally exceeds that sound level it starts flashing a LED.
That should be possible as long as you have access to a real SPL meter for calibration.  

I built a VU meter "effect".   It's a string of LEDs that bounce up & down to the loudness of the music, but it's not a true meter because it's not calbrated so it can't truly measure anything...  In fact-it "self-calibrates" to the changing long-term average for lots of "meter action" no matter what the volume setting.  (My meter effect doesn't have a microphone, it hooks-up to the line-output of an audio device.  If I wanted to use a mic, I'd also need a preamp.)

Note that with music the average is typically around 18dB below the peak.   The average correlates with perceived loudness better than the peak.  So, you'll probably want a short-term average (at least a second or so).  

Also, since our ears don't have flat frequency response, there is something called A-Weighting.   You may be able to ignore this if you don't need super-accurate readings and if the "character" of the sound is always the same (crowd noise, music, etc.) as long as you calibrate with an accurate A-weighted SPL meter.

If you need A-Weighting, I'd guess it's easier to implement on the analog side, before the signal hits the Arduino ADC.

Maybe I need another sensor to capture ambient sound too?
If you want to digitally record the sound, uncompressed audio takes a ship-load of memory and I wouldn’t recommend the Arduino.

If you just want to record the loudness or the loudest reading, that’s easier (depending on how many data-points you want to save).

It would also be super-easy to add a 2nd LED that latches-on (stays on) to "remember" if the threshold was exceeded.
612  Using Arduino / Programming Questions / Re: Program stop working after about 30 seconds? on: May 06, 2013, 07:16:37 pm
Change start to type unsigned long.

A 16-bit signed integer will "roll over" and become negative if you try to go over 32,767.    (30,000 milliseconds is 30 seconds. smiley-wink

millis() returns an unsigned long, and it will roll-over after about 50 days. 
613  Using Arduino / Programming Questions / Re: How to emit a frequency from an infrared led on: May 06, 2013, 07:10:37 pm
I've never done that, but look into serial communication.  For example, RS-232 communicates at a known baud rate.   

Technically, the LED emits at a given light-wavelength/frequency in the IR band, and by turning it on & off at 38kHz, you are modulating it at 38kHz (or transmitting at 38kHz).   

The wavelength doesn't matter to the Arduino, it just has to match the receiver.   
614  Using Arduino / General Electronics / Re: Trouble with transistor's on: May 06, 2013, 06:54:19 pm
It looks like the same part, so you shouldn't see a difference.  What kind of "trouble"?    Is the LED/fan always full-on or full-off?   

This is a "wild guess", but I wonder if the resistor on the assembly helps prevent damage from static discharge, and the loose part is getting "zapped" during handling?

If the parts are dying for no apparent reason (not over-voltage, over-current, or over-heating), static discharge is a likely cause.

Once the resistor is "permanently" connected to the MOSFET, that would provide some static discharge protection.
615  Using Arduino / LEDs and Multiplexing / Re: Help with getting started with an LED driver (AS1100PL) on: May 06, 2013, 05:42:40 pm
That is sort-of an advanced chip... I've never used one.   Troubleshooting could be tricky when the display-chip acts differently than what you expect...

You probably should start by experimenting with a simpler shift register.   There is an example project here.  (I have used something similar to that...)   If you can write a hex value to the 74HC595 chip, and see that value displayed as an 8-bit binary "number" on 8 LEDs,  you'll probably feel better about using the AS1100 chip.

You'll need to read the datasheet several times!!!   Make sure you understand what all the pins are for (especially the input/control pins), how the serial communication works, and what the various commands (hex codes) do.

With this chip, you write data to an internal register by sending a 16-bit word that contains a register address (4-bits) and the data (8-bits) to be sent to the register.  The 4 most significant bits are "don't care", but something needs to be sent so you'll normally send zeros.

The Windows calculator in the scientific mode can convert between hexadecimal and binary, or you can memorize the 16 conversions (0-F) and you'll be able to convert numbers of any size between hex and binary in your head!!!   It's much easier than converting between decimal and binary, because each nybble (group of 4 bits) converts to exactly one hex digit.   (You already know 1 and 0, so that's only 14 more to learn, and some are easy to remember like F, 5, & A.)

The datasheet shows hex and binary.   I suggest you use hexadecimal in your sketch (put 0x in front of the number to indicate hex).  You can use decimal if you really want to, the compiler doesn't care since everything is binary inside the microprocessor anyway.  (On the AS1100 datasheet, an uppercase X means "don't care" and a zero followed by a lower case x means the following digits are hex.)

The serial data communication concept is fairly simple...  once you "get it".    You "clock-in" data one bit at a time, and then after you've sent-in 8 or 16-bits, you "latch" that data to the parallel outputs.

You need to assign 3 Arduino-output pins (data, clock, latch).  The actual signal names might be different on various chips, but the function is the same.

1. Write to the data pin (one bit high or low).
2. After the data-pin is stable, write to the clock pin  (With the AS1100 chip, data is read on the clock's rising-edge).
3. Write to the clock again to reset (Write low, to get ready for another rising edge.)
4. Write the next bit to the data pin (bit high or low).
... Repeat until all bits have been written (16 bits for the AS1100).
5. When all bits have been written, Write to the latch pin.  (With the AS1100, data is latched-in when on a rising edge.)
6. Reset the load pin to get ready for the next rising edge.

Usually, the exact timing is not that critical.   The important thing is that the data is stable for a short period of time, before the clock-edge comes along.   
Pages: 1 ... 39 40 [41] 42 43 ... 90