| Arduino Forum ::  Members :: wikitjuggla
 Show Posts Pages: 1 [2] 3 4
 16 Using Arduino / General Electronics / Re: Using Mosfet For PWM In HHO Generator on: December 16, 2013, 02:56:13 pm Quote from: Peter_I on December 16, 2013, 02:08:30 amHere is one from the Playground:http://playground.arduino.cc/Code/PwmFrequencyDoing an analogRead of the pot, then using that value to set the value should be absolutely doable.It looks like the answer  to your question is "yes it can be done, but it is a little messy".Thank you for answering that, but define "messy". I've only been playing with arduino for a year now and i can't make heads or tails of this codeCode:/** * Divides a given PWM pin frequency by a divisor. *  * The resulting frequency is equal to the base frequency divided by * the given divisor: *   - Base frequencies: *      o The base frequency for pins 3, 9, 10, and 11 is 31250 Hz. *      o The base frequency for pins 5 and 6 is 62500 Hz. *   - Divisors: *      o The divisors available on pins 5, 6, 9 and 10 are: 1, 8, 64, *        256, and 1024. *      o The divisors available on pins 3 and 11 are: 1, 8, 32, 64, *        128, 256, and 1024. *  * PWM frequencies are tied together in pairs of pins. If one in a * pair is changed, the other is also changed to match: *   - Pins 5 and 6 are paired on timer0 *   - Pins 9 and 10 are paired on timer1 *   - Pins 3 and 11 are paired on timer2 *  * Note that this function will have side effects on anything else * that uses timers: *   - Changes on pins 3, 5, 6, or 11 may cause the delay() and *     millis() functions to stop working. Other timing-related *     functions may also be affected. *   - Changes on pins 9 or 10 will cause the Servo library to function *     incorrectly. *  * Thanks to macegr of the Arduino forums for his documentation of the * PWM frequency divisors. His post can be viewed at: *   http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235060559/0#4 */void setPwmFrequency(int pin, int divisor) {  byte mode;  if(pin == 5 || pin == 6 || pin == 9 || pin == 10) {    switch(divisor) {      case 1: mode = 0x01; break;      case 8: mode = 0x02; break;      case 64: mode = 0x03; break;      case 256: mode = 0x04; break;      case 1024: mode = 0x05; break;      default: return;    }    if(pin == 5 || pin == 6) {      TCCR0B = TCCR0B & 0b11111000 | mode;    } else {      TCCR1B = TCCR1B & 0b11111000 | mode;    }  } else if(pin == 3 || pin == 11) {    switch(divisor) {      case 1: mode = 0x01; break;      case 8: mode = 0x02; break;      case 32: mode = 0x03; break;      case 64: mode = 0x04; break;      case 128: mode = 0x05; break;      case 256: mode = 0x06; break;      case 1024: mode = 0x7; break;      default: return;    }    TCCR2B = TCCR2B & 0b11111000 | mode;  }}
 17 Using Arduino / General Electronics / Re: Using Mosfet For PWM In HHO Generator on: December 15, 2013, 10:43:21 pm Quote from: zoomkat on December 15, 2013, 10:37:49 pmFor only \$10 shipped, trying to make a high current controller seems a waste of time. http://www.ebay.com/itm/10-50V-40A-DC-Motor-Speed-Control-PWM-HHO-RC-Controller-12V-24V-48V-2000W-MAX/261354955983?_trksid=p2045573.m2042&_trkparms=aid%3D111000%26algo%3DREC.CURRENT%26ao%3D1%26asc%3D19457%26meid%3D3429344516027746522%26pid%3D100033%26prg%3D8797%26rk%3D1%26rkt%3D4%26sd%3D261354955983%26Did you notice in the fine print that at 12v it is only capable of 480 watts? plus i want to control frequency using arduino, speaking of which, no one has told me if i can use a pot to adjust pwm frequency on arduino given the right code. It feels better building things yourself lol
 18 Using Arduino / General Electronics / Re: Using Mosfet For PWM In HHO Generator on: December 15, 2013, 10:12:32 pm alright so I looked at one of these gate drivers, So do i just need to hook the power and ground, then pwm input from arduino then pwm output to mosfet? can i use more than one mosfet per chip? user dc42, does that mosfet http://uk.farnell.com/nxp/buk652r3-40c/mosfet-n-ch-40v-120a-sot78/dp/1863285 that you recommended have a low voltage drop? could I use 3 or 4 of them in parallel just for safe measure and to ensure no overheating all off of the same gate driver? I was looking at this gate driver http://www.ebay.com/itm/TC4421-A-MOSFET-IGBT-10A-Gate-Driver-Inverting-TC4421A-TC4421AVPA-/181069759903?pt=LH_DefaultDomain_0&hash=item2a2899459f
 19 Using Arduino / General Electronics / Re: Using Mosfet For PWM In HHO Generator on: December 15, 2013, 12:57:51 am as far as the 10v gate voltage, what if i used a small step up transformer to bring the arduino pin up from 5 to 10 volts, but i'd prefer not doing it this way
 20 Using Arduino / General Electronics / Re: Using Mosfet For PWM In HHO Generator on: December 15, 2013, 12:01:35 am would a motor controller actually work? Cause I have a sabertooth 2X35 motor controllerhttp://www.dimensionengineering.com/products/sabertooth2x25Kinda seems like a waste of a \$125 chip though
 21 Using Arduino / General Electronics / Re: Using Mosfet For PWM In HHO Generator on: December 14, 2013, 10:35:46 pm I don't know anything about gate driver chips. And when I say reducing the frequency, I mean down to more like, say we are switching half on, half off, I want it on for something like a quarter of a second on, a quarter of a second off. And to stick to what i know, how about using several mosfets in parallel to allow me to use a 5v gate drive. Plus I already have an arduino plus several homemade arduinos. I don't have a gate driver. And as far as heat sink is concerned, How about just slapping an old school Pentium 2 processor heat sink on them. Those things are huge. On another note, Can we please keep this discussion to mosfets and arduino. I have done my research on the HHO generators and have read a many forum about them. I don't mean to be rude, just trying to stay on topic and to each their own about the generators. And none of this has anything to do with my brakes. and i meant mosfet will be driving up to 30 amps continuous. I meant I will rarely (and when i do only in short, few minute bursts) drive it up and over 30 amps. And a mosfet with very little voltage drop would be best as well but idk if i will be able to have my cake and eat it too on that one
 22 Using Arduino / General Electronics / Re: Using Mosfet For PWM In HHO Generator on: December 14, 2013, 04:46:36 am well if that mosfet can handle 120 amps, would only pushing it to 30amps, and rarely and for short bursts of time pushing it past that, require very big of a heat sink? Would attaching it to a car firewall under the hood make a sufficient heat sink? problem though, I need a 5 volt gate voltage to drive it with an arduino pin. Arduino runs a fairly high switching frequency and I am looking to probably lower that switching frequency which would also help with the mosfet heat management. Another thing, I am going to be wiring in a volt/ammeter on the negative side of my load so would i be better off with a p channel or n channel mosfet and if using the n channel, would i put that between my load and the ammeter or between the ammeter and negative ground? It would be more convenient for me to wire the mosfet to ground after the ammeter because then i would only need to run 1 wire through my firewall under my dash
 23 Using Arduino / General Electronics / Using Mosfet For PWM In HHO Generator on: December 14, 2013, 03:18:32 am Not really sure whether I should put this topic here or in Project Guidance but hey. So I am going to attempt to build a HHO Generator (Hydrogen, Hydrogen, Oxygen). It separates water molecules. Now a big issue with these is controlling current flow. Its easy enough to do with your electrolytes but if you live in a place where 20 degrees is a nice day you need to pump in a crap ton more electrolytes to keep your water from freezing. Rather than spend \$80 on a PWM control unit I figure I can build one with an arduino. What would be a good mosfet to use for 11-15 volts at 0-30 amps. Preferably a mosfet that could handle more amps than that but up to 30 is a definite. On another note, is it possible to control the switching frequency on an arduino and if so, could the frequency be variably controlled using a POT? I haven't played with my arduino in some time so I have gotten rough around the edges with it.Thank You
 24 Using Arduino / Project Guidance / Re: Automobile blinker lights on: July 25, 2013, 12:11:14 pm well i just tried what you said and it worked, thank you very very much, took less than 10 minutes too
 25 Using Arduino / Project Guidance / Re: Automobile blinker lights on: July 25, 2013, 11:39:58 am well i already disabled the day/night automatic headlights. They are controlled by relays behind the glove box and i just put a switch interrupt before the relay therefore allowing me to disable, or enable the automatic headlights rather than permanently eliminating them. As for the e brake thing, i tried that already but as soon as you take the car out of park, the bell chime just goes ding ding ding ding ding forever without quitting until you put it back in park, as for that control box i might have to look into that, thanks for that info, i know the relays that control the DRL for the blinkers are located in that
 26 Using Arduino / Project Guidance / Re: Automobile blinker lights on: July 23, 2013, 09:58:32 am i think i just give up haha, probably the only way around this is rewiring the entire thing and it is probably more effort than its worth, also the wire going to the blinker switch alternated positive and ground when it was flashing and i disconnected it once and the blubs still stayed illuminated even when turning on the blinker switch so somehow, that positive, ground fluctuation is what disables the constant on
 27 Using Arduino / Project Guidance / Re: Automobile blinker lights on: July 22, 2013, 08:09:58 pm well i just took all that stuff apart and the flasher unit has 3 pins, one pin with 2 wires going to it which had 12+, a ground wire, and a wire which i assume is what goes straight to the turn signal switch based off of all the tinkering i did with it. And as for the relay that controls the blinkers turning on during the day, its located inside of a box about the size of an ECU with just as many, if not more wires leading into it. I figured this out by parking in front of a window and turning the key on and off then following the sound and after i found it i could feel the click with my finger inside the upper left corner of the box
 28 Using Arduino / Project Guidance / Re: Automobile blinker lights on: June 27, 2013, 01:21:57 pm i think i see what you are saying, when the headlights turn on, the double throw relay disconnects the blinker light circuit and connects the headlights to turn them on therefor turning off the blinker lights. I already know where the headlight relays are and i would assume the double throw would be on the front headlight relay except one flaw with this is how does the blinker light blink when the signal switch is activated unless it is all run by a microcomputer
 29 Using Arduino / Project Guidance / Re: Automobile blinker lights on: June 26, 2013, 01:37:11 am Quote from: Nick_Pyner on June 26, 2013, 01:08:52 amI suspect the Buick is something similar. [/quote]Yeah you are probably right, so in the event of that, what would you recommend i do? Probably try and find the relay then clip the wire that turns the blubs on constant and rewire the blinker switch to the relay side of the clipped wire. that might even be easier than if the pulse signal goes through the blinker switch