Can anyone help me with an arduino/circuit?

I see in your circuit you still have v_bec listed does this mean I will still need to hook the 5volt up to this circuit?

bart796:
… does this mean I will still need to hook the 5volt up to this circuit?

Yes it does. The comparator needs a known, fixed voltage to compare the dropping battery voltage to. I could have used a voltage regulator of some sort (a resistor and an zener diode) but that would be more parts. Since the BEC 5V is available already, why not use it ?

ok thats totally fine just making sure. Also in my haste to want to test it i bought all the parts from radio shack but they did not have the 339. They had a 324 and i bought 2 because the internet said only difference is this one can take more volts? If i cant use it i will take it back but it was just all they had and an impulse buy essentially

Ok apparently im moronic i have been looking at how to wire diagrams all day…i have all these parts on my breadboard minus the resistors which i was going to add at the end…i cant figure out positives and negatives and which is going to be where…let me write out what i think and see if im correct? Ok on my breadboard i have the 2 chips the mosfet the POT and the CAP. I assume the V_Batt is the positive wire from my battery that runs into the POT, the VCC on both chips and also down to the 100k resistor and back into the IN on the other chip. Am i correct on that? Then my BEC 5 volts positive rail only will go into the first chip only (but i assume it needs to also give ground somewhere…unless the ground can be the same ground directly from the main battery?) That is my take on things.

bart796:
ok thats totally fine just making sure. Also in my haste to want to test it i bought all the parts from radio shack but they did not have the 339. They had a 324 and i bought 2 because the internet said only difference is this one can take more volts? If i cant use it i will take it back but it was just all they had and an impulse buy essentially

An LM324 is a quad package op-amp, not at all the same thing as a comparator. While you might come up with a design that works using op-amps, this isn't that design. It depends on the comparator have what's known as an "open collector" type output. Google it. Basically an OC output either provides a short to ground (in one state) or an open circuit meaning no current flows out of, or into the device (in the other state). In fact one of the problem I had early on was using an LT1017 comparator instead of the LM339. The former doesn't have OC type outputs. There may be other OC type comparator ICs, I'll have to look them up.

bart796:
I assume the V_Batt is the positive wire from my battery that runs into the POT, the VCC on both chips and also down to the 100k resistor and back into the IN on the other chip. Am i correct on that?

Yes, but the battery voltage goes into R3 (100k) **and** R1 (10k). It doesn't tie directly to the IN on the 2'nd comparator.

bart796:
Then my BEC 5 volts positive rail only will go into the first chip only (but i assume it needs to also give ground somewhere…unless the ground can be the same ground directly from the main battery?) That is my take on things.

It's my belief that the battery ground and BEC ground are the same ground. I can't see how it would be any different. But you could use an ohmmeter to verify it.

FWIW RS says it carries the LM339 …

http://www.radioshack.com/product/index … Id=2062593\

An LM393 is a dual comparator w/OC type outputs. RS doesn’t seem to carry it.

http://www.ti.com.cn/cn/lit/ds/symlink/lm393-n.pdf

The capacitor should be a ceramic type and rated for at least 16V. You might also want to put another one (0.1uf ↔ 1.0uf) as close to the comparator IC as possible; one end on the Vcc pin and the other on the ground pin.

ah wasted money lol oh well…i will have to order the 339 online because they dont have it in store i have everything else though so sweet that works for me ill just save those pieces might find a use for them possibly ill let you know when i get the other pieces in after ordering them

Hmm the capacitor i bought was something called tantalum 1.0uf is that the right type? If not ill order a different type when i order the 339 im going to order them from ebay i can get 10 for a couple bucks that way if the circuit works out great i can put them in a few different planes and my dad can put a few in his planes since we can easily get the other components from radio shack (except a 250k resistor…thats apparently as rare as bigfoot…i looked in every variety pack and every singles packs in every wattage they had so i said screw it and bought a variety with 100k and 150k and was just going to put them in series for 250k ha) the parts i bought today are IRF510 Power Mosfet, 10kohm micro size POT, the 1.0 uf Tantalum Cap, a huge variety pack of resistors, and apparently 2 of the wrong chips which is my bad but it happens so oh well. Oh and a breadboard kit to test it all. Those are all radioshack part numbers if you want to look and see if i got radio shack equivalents of what you listed in the circuit

Hmmm I’d rather the cap be ceramic but a tantalum should work. It’ll “leak” a bit more than a ceramic meaning the blinking rate will be slower than expected. My only worry is tantalums have a nasty habit of exploding when subjected to high currents. The oscillator portion of the circuit basically charges up the cap to 2/3 of the battery voltage and then rapidly discharging it. I dunno, give it a try and don’t be surprised if it releases the magic smoke. In any case caps have a voltage rating and whatever you use must be 16 V or greater.

Using 2 resistors in series to get your 250k is OK.

The IRF510 FET should be OK though it has a higher resistance when switched on than I’d care for. That means it might get hot when sinking all the current of all your LEDs. It might need a heat sink so when you get it all working, check how how it gets.

Well i can order the correct stuff i only bought that stuff on impulse i went to get a bread board and said screw it ill grab this stuff. Ill order the exact pieces you listed online and ill get a ceramic cap (if you dont mind perhaps link me to one so i get the exact right one? obviously im terrible at picking the right stuff haha…im like 0 for 5)

FWIW I had some spare time and finished the final no programming, uses all 4 comparators circuit. It does your original constant on then blink1 rate then blink2 rate then blink3 rate as the battery voltage drops. Like the last circuit is runs off the battery voltage and uses the BEC 5 V as a fixed reference. If you look at it you’ll see 2 more comparator with 2 more pots wired just like the 1’st comparator. It then adds 2 more timing caps that get switched in and out to vary the oscillator frequency.

And here’s a plot of the simulation results as the battery voltage drops.

bart796:
Well i can order the correct stuff i only bought that stuff on impulse i went to get a bread board and said screw it ill grab this stuff. Ill order the exact pieces you listed online and ill get a ceramic cap (if you dont mind perhaps link me to one so i get the exact right one? obviously im terrible at picking the right stuff haha…im like 0 for 5)

Here's a listing of 1 uf caps from DigiKey.

http://www.digikey.com/product-search/e … ageSize=25

Any of those would be good. I couldn’t find their equivalent at SF or RS.

A good alternative would be this …

http://www.radioshack.com/product/index … capacitors

But like I said you can use the cap you have, be sure to observe the polarity and it’s likely to be OK.

Another good thing about ceramic and (metal) film caps … they are non-polarized. You can’t put them in backwards. Tantalums and other electrolytic caps have polarity and you have to make sure the - lead is always less voltage than the + lead. In your case the - lead goes to ground and the + lead to the junction of the oscillator comparator - input, R2 and the first comparator output.

Ill just go ahead and order a different one and do i need to purchase 2 of those 339’s or am i using 1 and then 2 of the individual circuits in it? Also is this a good CAP to purchase (its bulk i like to buy more than one in case of error) http://www.ebay.com/itm/50-TDK-1uF-100V … 4618cc16c8

A single LM339 has 4 comparators in it. So you only need 1 … so long as you don’t kill it.

Those caps seem good enough. And now that I think some more, a good metal film cap may be just a bit better in this application than a ceramic cap. Either should be fine. A film cap might be smaller and more available.

Ill buy a 10 pack of the lm339 gives me room for error and the 50 pack of those ceramic only 10 bucks total for both ill order them and let you know when they come in so it will be a few days likely before i respond back to this thread but i will be back im not just skipping town!

Ok i have everything in and put it on the breadboard like i believe it was supposed to be…i have 12 volts at the gate and none at the drain…im not sure i did this right…the drain of the fet is connected to the negative of my led right? I did get the led to come on when i was testing for voltage and i did this buy putting the negative of my voltmeter on the gate and the positive on the 12v rail and my led lit up and i turned it off by turning the POT which was wierd because i dont think that should have actually happened? I have double checked it and i am fairly confident it is connected correctly.

Actually upon further testing the drain is sitting at 5volts until i do that thing with the voltmeter touching the positive to the battery positive and the negative of the voltmeter to the gate leg of the FET. At this point the drain jumps to 11.1 volts.

Hmmmm … time to check the basics. Is the source of the FET tied to ground ? Verify w/an ohmmeter. The drain s/b connected to your LED -, but read the caution below. If the “battery” voltage is high enough, then the gate should be pulled up to the battery voltage and that should turn the FET on. Thus the drain should also be pretty close to 0V wrt ground. If the FET is off (gate is grounded), the drain s/b at battery voltage. You can short, w/a wire, the gate to ground w/o damaging anything (assuming it’s wired per the schematic) and see the test LED go off. Try that.

Let me caution you … if you’re using a typical solderless breadboard, it won’t work well w/your plane’s LEDs. It’s just too much current. These type BBs aren’t good for currents > 1A. Use a resistor&LED as a stand-in for your LED strings, just for test.

OK it’s sounds like there’s a ground missing somewhere. That’s so easy to miss. Double check everything. Post a good pic of your BB and I’ll see what I can see.

I am using a test strip with only 3 leds in it so it should be drawing minimal amounts of current i am fixing to take everything off and redo it and see if i can get it to work then ill take a picture if it does not work