Show Posts
Pages: [1] 2 3
1  Using Arduino / General Electronics / Will this audio input circuit affect what it's connected to? on: February 25, 2014, 04:17:30 am
I've made an audio meter with my Arduino and a sexy OLED display. The audio input is a simple circuit I found on Google:

It works really well. My question is: if I connect this circuit to the wires between my computer and my powered monitors using a simple Y-splitter cable, will my circuit affect the audio going to the speakers? I'm not worried about a little attenuation, but is there a chance this circuit will interfere with the character of the audio - the frequency response etc?
2  Using Arduino / General Electronics / Re: What happens if AREF exceeds Vcc by a tiny bit? How to raise Vcc (hack the reg)? on: October 16, 2013, 01:01:25 pm
Cool - thanks for the ideas and advice.

I think I'm going to go for a lower voltage reference and then scale my inputs down accordingly. Learnt lots, ta smiley
3  Using Arduino / General Electronics / What happens if AREF exceeds Vcc by a tiny bit? How to raise Vcc (hack the reg)? on: October 16, 2013, 11:08:38 am
If I hook a 12V supply up to my Arduino and then measure the 5V line, I get a fraction under 5V - around 4.96V. It seems to vary a little, depending on what the Arduino's doing. There aren't any huge loads; main thing is an nRF24L01+ transceiver that grabs 100mA-odd for a few milliseconds each second.

That's 1% error, though, which I want to reduce. I thought I'd hook up a precision 5V from a proper voltage reference chip (Analog Devices REF02CPZ).

Two questions:
  • given that my Arduino is powered by less than 5V, that means the AREF pin is going to be higher than Vcc - not enough (I'd think) to hurt it, but will the AREF pin be clamped down to Vcc?
  • if so, I need to bump the voltage from the Arduino's regulator by a bit. I understand you can stick a diode on the ground pin of a linear regulator to raise its output by the diode's voltage drop, so a 0.2V-drop Schottky should be enough, right?

4  Using Arduino / General Electronics / Re: ADC input from +12 to -12V - internal diodes enough protection? on: October 14, 2013, 09:03:00 am
Spectacular. Thanks folks smiley
5  Using Arduino / General Electronics / ADC input from +12 to -12V - internal diodes enough protection? on: October 14, 2013, 06:48:38 am
I need to measure a voltage that may range from -12 to +12V, relative to ground.

I'm only interested in readings that are between -12V and 0V, though; if the voltage goes above 0 I don't care what the reading is.

From another thread I learnt you can measure negative voltages with a resistor divider, so this circuit:

... should let me read anything from -12V to +5V. That's all I need.

However, if the input voltage is higher than +5V, the voltage at the Arduino's input pin could go up to 7V. Do I need to protect the Arduino from this, or will its internal protection diodes be enough? We're talking about a maximum current of 0.1mA. Should I do this:

I'm guessing that if the verdict is yes to external diodes, I'll need to use Schottkys for their low voltage drop...

Thanks!  h
6  Using Arduino / General Electronics / Cheapest way to charge a 15V battery from solar panels? on: October 11, 2013, 03:44:11 am
*update* - I've found a relatively cheap DC-DC converter on eBay - 20A, variable output voltage:
...would this be the answer to my problems?

I have 400W of nominally 12V solar panels. At peak power they present around 17V.
The panels produce enough power for our nightly needs (30Ah/day), but storage is the problem: car batteries are horribly inefficient and waste a large proportion of the juice, so I've just bought a monster 60Ah Lithium battery (LiFeYPo) to store the power.

The problem: the new battery operates between 10 and 16V; if I use my existing 12V solar charge controller the battery is never charged beyond around 13.2V, which equates to around a quarter of its capacity.

What would be my simplest approach to charge this battery from the panels? I want to charge it up to 15V ideally.

I could:
a) connect the panels straight to the battery, via a blocking diode, and an over-voltage cut off (arduino + relay)
b) use an off the shelf (ie eBay) DC-DC buck converter set at 15V. I'm not clear on what impedance this would present to the panels though: if the battery is fairly flat it'll happily absorb as much current as the converter can produce, but does that mean the converter will look to the panels as if it's nearly a short-circuit? (If so, it won't harm the panels, but they won't operate at very good efficiency)
c) buy a simple (ie analog) PWM 12V controller and try and hack it to produce 15V instead ... (I'm guessing that somewhere inside there'll be a feedback resistor I can play with)
d) keep looking for a proper solar-lithium charger (specialty item = horribly expensive)
e) build a custom PWM controller for it (bit advanced for me, especially if it's got to handle up to 30A of current)
f) stop complaining, stick with my MPPT 12V controller, live with the reduced capacity because it's still working miles more efficiently than the lead acid batteries.

Thoughts? Budget is tighter than a gnat's chuff, so hacky solutions are grand. Over- and under-voltage protection are trivial to implement (I can watch the voltage with an Arduino, cut things off with a relay in case of danger). The lithium battery is designed as a swap-in replacement for lead-acid batteries, so it's fairly resilient to abuse (as opposed to vanilla Li-Ion cells). It can handle up to 60A of charge current, way more than I could ever produce.

(Gotta say, I love this lithium battery - stick 10Ah into it and you can get 9.9Ah out of it again, as compared with lead acid, where I'd be lucky to get just half the juice out again)
7  Using Arduino / Programming Questions / Re: Storing strings of various lengths - am I doin' it right? (pointers) on: November 09, 2012, 06:58:08 am
Cool, thanks! smiley
8  Using Arduino / Programming Questions / Storing strings of various lengths - am I doin' it right? (pointers) on: November 09, 2012, 06:10:28 am
Absolute newbie C question. I need to store some static phrases to put on a display, but the lengths of them vary. Which of these options is the best way to store the strings?

char myPhrases[][]= {"hello","goodbye","please go away"};

// I think this would allocate 15 characters (ie length of the longest string)
// to every string whether needed or not - is that correct?

Then I tried:

char allMyPhrases[] = "hello\0goodbye\0please go away\0";
char* myPhraseOffsets[] = {0,6,14};

// This ought to be as space-efficient as possible, but it's a
// pain to change one of the first phrases as you have to
// re-count all the offsets by eye

But this seems to work, too, and kinda looks more correct as well as being more programmer friendly:

char* myPhrases[]={"hello","goodbye","please go away"};

// but I can't tell if it's padding the strings or not.

When I google "storing strings of different lengths" I end up with results that seem overly complicated, linked lists and vectors and stuff. What's the standard C programmer's approach to this?

(I know that as the phrases are static, I ought to put them into the PROGMEM bit of the chip, but that can come later once I've sussed this pointers malarkey)

Thanks, h
9  Using Arduino / General Electronics / Re: Running a stepper motor directly from Arduino outputs... will zeners help? on: October 18, 2012, 09:58:34 am
Thanks for the advice! So I can get my head round this:

... the forward biased zener will add a .7v drop to forward voltage...  in essence leaving you to shunt excess voltage that must first reach a potential of 7.5V before shunting occurs... which already exceeds maximum pin parameters.

Understood - seems to be down to my clumsy selection of 6.8v zeners. But if I used 4.7v zeners instead, the voltage would only hit 5.4v before shunting.

Using Schottkys in the configuration you suggested would protect against voltages over 5.33v (assuming BAT-43s with a .33v drop), which is only half a volt-ish more protection than the zeners but with double the component count - is this enough of a reason to use your 8-diode method over my 4 zeners? Is there another reason not to use zeners?

Have you measured the resistance of a stepper winding? If it's less than 80 ohms then you really should use a driver.

Resistance of the windings are around 270 ohms if I remember right - oh, which would mean around 18mA draw per IO pin.

Ooh, can we see picture or link to these tiny steppers?

Two types I'm trying to drive with minimal extra circuitry. The first one (not out of a camcorder, d'oh - got my steppers confused - it's from a cheapo Chinese electronic rev counter dial) :

All it has to move is a tiny plastic needle indicator. Inside, it's more like a watch mechanism than a normal stepper:

Two coils, some metal plates to carry the magnetic field (I really don't know what I'm talking about but it all sounds plausible), and the tiny little black cog in the centre is magnetic.

It was a bugger to get back together the first time smiley It works really well, though; it's surprisingly strong and with the help of the Arduino AccelStepper library it's fast, accurate and repeatable too.

If I can drive them without killing the ucontroller, these are the camcorder lens motors I want to drive. They're like miniature floppy drive head motors. The photo makes them look way bigger than they are in real life. Dinky, huh smiley

Atmega168 TQFP on the left, 0805 resistor below. (Old obsolete key, feel free to make copies - they won't let you into my secret workshop smiley-wink
10  Using Arduino / General Electronics / Running a stepper motor directly from Arduino outputs... will zeners help? on: October 17, 2012, 08:51:45 am
OK, I know it's generally a no-no to connect motors straight to an Arduino, but the stepper motor I'm driving is minute. It's tiny. Open frame, just two coils and a little magnetic rotor.

I dug a stepper motor out of an autofocus lens, soldered four little wires to it and stuffed them in the Arduino outputs. I've got spare Atmega chips if I blow this one, but the motor seems to run fine on 5 volts; the current draw is a little under 10mA per coil.

If I was connecting anything else coil-based (like a relay) to an Arduino, I'd stick a diode across the coil facing the other way, so when the coil's power goes off and the magnetic field collapses, any voltage it generates can dissipate through the diode rather than zapping my Arduino. That approach won't work with my stepper, as the voltage across the coil could be in either direction depending on which step the motor's at.

But then I was wondering - those little zener diodes - if you try putting a voltage the wrong way across them they won't conduct unless the voltage goes above their reverse breakdown voltage, at which point they conduct. So could I do this...

...? (I've only marked them as 6.8v as that's what I have sitting in the parts box at home - I'm guessing I just need something larger than 5 and less than whatever the Arduino's maximum GPIO pin voltage is allowed to be).

I think I've seen this two-diodes-facing-each-other thing before, but didn't really understand it. Here, it looks like it could theoretically protect my Arduino against any nasty voltage spikes without interfering with the normal motor operation. And without me having to build a whole H-bridge thingy... ick.

Does this seem sensible? Any tips?
11  Using Arduino / General Electronics / Re: Protecting PCBs against tarnishing - on the cheap? on: October 05, 2012, 11:00:21 am
(note to self - must remember to etch her a message on the PCB somewhere too, chicks love that sorta thing)

Store a few messages in the mcu and display a rolling image of them from time to time (at the hour, on alarm, etc.)

You will score lots of points with her.

Hehehe - yep, definitely. It'll be a little limited given I've only six 7-seg displays to work with. There's about a digit's worth of empty space between each pair of digits, too; I wonder whether scrolling messages will work best if I ignore the gaps (ie treat it as a 6 digit display) or if I pretend they're there (treat as an 8-digit display, so characters disappear behind the gaps)... Got until Christmas to suss it all out though smiley
12  Using Arduino / General Electronics / Re: Protecting PCBs against tarnishing - on the cheap? on: October 05, 2012, 05:25:11 am
How are you gonna plug something in if the connector
pins are coated?
[snip] .. so who cares what it looks like later on. What's important is
having good connections.
[snip] Fourthly, it's lots easier to buy professionally made pcbs and then the pads
are always pre-tinned in the first place.

Your points are, of course, valid in most situations but I'm after the aesthetic as well as the functional - I spent so damn long designing and milling this clock board that I want it on show when I'm done. Gonna mill out a nice clear acrylic case for it too. Otherwise I could just buy my wife a 99 pence clock (and it'd probably be more accurate, LOL). Can't afford to buy her something posh for Christmas this year so coming at it from the sentimental-value angle. Look babe, I didn't buy you jewellery, but I made you something you'll look at every day...  smiley-kiss

(note to self - must remember to etch her a message on the PCB somewhere too, chicks love that sorta thing)

Thanks for all the input guys smiley
13  Using Arduino / General Electronics / Re: Shift regester question on: October 04, 2012, 03:52:48 am
Limited experience of this, but I think you'll have no problem sharing the data and clock pins.

You'll probably need to keep the latch pins separate - one for the input (4021), one for the 595(s). When you read the inputs from the 4021, that same data will be getting streamed out to the 595s at the same time (if you're sharing pins) but as long as you don't touch the 595 latch pins, it'll be safely ignored and won't affect your outputs.

You'll need to change the pinMode of the data pin (from INPUT to OUTPUT or vice versa) depending on whether you're reading from the 4021s or writing to the 595s but I don't think that'll have any unwanted effects elsewhere as long as you're careful to only latch the output data when you mean to.
14  Using Arduino / General Electronics / Re: Protecting PCBs against tarnishing - on the cheap? on: October 04, 2012, 03:42:55 am
Ahh... perfect, thanks. Found a can on eBay, much cheaper than tinning solution (and what can I say, I prefer that salmon pink copper look to silver)


15  Using Arduino / General Electronics / Re: Problem dimming filament displays vs. LED displays on: October 04, 2012, 03:39:54 am
Or you could directly PWM the outputs themselves

That would require tremendous amount of data being sent over the spi. I would say that's practically no-workable.

I bought one of those 5 metre long RGB LED strips with a little control box and remote a while back, and pulling it apart (welcome to my home, new victim) I noticed it used a tiny PIC and a plain ole' 595 to control the 3 channels' MOSFETs. Made me wonder how fast you can update shift registers. Obviously becomes less practical the more 595s you have chained together. Also made me wonder why they chose to use two separate chips rather than just using a PIC with more legs/outputs on it...

PS thanks for the compliments on my PCB construction, I always think they end up looking a bit hacky but it's nice to get a thumbs up from you folks smiley
Pages: [1] 2 3