Register or Log In To remove these advertisements. |
|
|
|
Thread Tools | Display Modes |
05-25-2018, 10:27 AM | #1 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Any electronics nerds interested in Arduino/Atmel?
I would like to build a little "automotive helper" board that does some common features that I always seem to need:
- Three relays for controlling dual fans in parallel or serial modes - Interior light dimming, theater mode, etc. - Fuel pump control (reduced pump speed at low engine rpm) - Tach signal conversions (8 to 6 to 4, etc) Stuff like that, likely other stuff I haven't thought of but could be easily added. I can do that software side in my sleep but I am pretty poor with hardware. I can solder and breadboard but not design very well. For example, to trigger a relay I know in software I need to command an I/O line to go low. But you can't just drive a relay off a chip's I/O line, you need to actually excite a transistor which then fires the relay. But that's above my pay grade. I couldn't breadboard it safely for you, because I only know the general principles and ideas. I thought if there was someone out there that mastered their "300 in One" Radio Shack kit as a kid, perhaps we could do something together! Let me know if you're interested. Not trying to get rich, just needed some circuits and thought it'd be an interesting way to learn something new!
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
05-25-2018, 11:44 PM | #2 |
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
I'm working on stuff like that for my truck. I have designed and prototyped a vehicle speed compensated intermittent wiper control. And working on a headlight harness with partial-brightness daytime running lights. I'll be using plain sealed beam halogen bulbs, I've not been very interested in the non-DOT expensive non-stock looking bulbs with halos and all that jazz. Then there is the cluster light rheostat to PWM (pulse width modulation) LED dimmer to smooth the dimming and allow dimming all the way down to nothing with the headlight switch's rheostat. Switch-free capacitance touch circuit for a kill switch or to switch other things. One day I will add power windows of the type that use the switch built into the window crank, and I'll want to double tap that crank switch to make it control the passenger side window. I've got too many project ideas so I'm not getting anywhere with them, it's a slow process. All this stuff is relay free, using just transistors for the high current switching. Power MOSFETs, metal oxide semiconductor field effect transistors. Arduino can control all that stuff, and they are so cheap that you don't need to have a central controller for everything, you can use just a few pins of a controller chip for the individual project and seal it up in a project box and wire it up to the truck. Then select another project and use another controller. How about cruise control? I'm designing that in my head right now. I can help with hardware design.
Wiper controller example And the breadboard prototype of it |
05-26-2018, 11:27 AM | #3 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
Cool! Maybe if I start with some real basics, I'll be able to follow along and others will benefit from my noob-level questioning!
Perhaps the most simple: control ON/OFF of a 12V relay. I understand I cannot drive the relay coil magnet directly, but this guy seems to do it. Is there support circuitry on the UNO that's being used, or how does he do it? https://www.google.com/search?q=cont...TF-8#kpvalbx=1 Once I know how to do ON/OFF, I'll ask about power transistors. But let's start with ON/OFF! int in1 = 7; void setup() { pinMode(in1, OUTPUT); digitalWrite(in1, HIGH); } void loop() { digitalWrite(in1, LOW); delay(3000); digitalWrite(in1, HIGH); delay(3000); }
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
05-26-2018, 12:07 PM | #4 |
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
It looks like the guy in that video is driving the relay directly. I think that is using the Arduino's processor beyond the specs and may damage it. So you have the right thinking about using a transistor to drive the relay.
2N3904 is a common transistor and good to use in that situation. I like this web page for explanation of using a transistor for this. http://www.ermicro.com/blog/?p=423 It also has the wiring for connecting a relay, and talks about a clamp diode (aka flyback diode) when driving an inductive load. Getting into this, although it is not really possible to grasp everything that is in a datasheet unless you're an engineer, it is good to read them anyway. I had a manager a while back who encouraged me to read technical stuff, and he said you won't get it all at first, and you may never get it all, but each time you expose yourself to it you will gain a little more. Now a few years later, I agree. Google "datasheet 2n3904" or "datasheet atmega328p" to find and download the PDF manuals for the various components you will be working with. The atmega328p is the controller chip in an Arduino. At the very least those data sheets will show you what pins are what on the component. After you buy a 2N3904 transistor, you are going to need to know which pin is the base, which is the emitter, and which is the collector. So, to just get down to the nuts and bolts of it, here is a doctored diagram from that ermicro blog I gave the link to above. You don't need a resistor in line with the relay, because the coil of the relay provides the correct resistance if you are connecting a 12V relay to your truck. 1N4001 is a common diode you can use as a clamp diode. And a 220 ohm 1/4 watt resistor is a common value to use to limit the current going from an Arduino pin to the base of the transistor. You can get this stuff on aliexpress.com if you are patient about delivery from China. bags of 50 transistors, a few hundred assorted values of resistors, bag of diodes, breadboard, etc. each for a couple bucks with free shipping. Last edited by dmjlambert; 05-26-2018 at 12:09 PM. Reason: spelling |
06-02-2018, 09:04 PM | #5 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
Thanks! I've been on vacation in Europe for a week and just got back - once I've de-lagged a bit I'll see if I can breadboard some kind of blinking light from what you've shared.
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
06-03-2018, 02:27 AM | #6 | |
Registered User
Join Date: Mar 2017
Location: Bonne Terre MO
Posts: 192
|
Re: Any electronics nerds interested in Arduino/Atmel?
Quote:
Ok, well thats pretty awesome. Are you going to be selling these? |
|
06-03-2018, 08:00 AM | #7 |
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
Well, let me get something going in my truck to prove it actually works. :-) Then we can talk about whether I can make extras.
|
06-03-2018, 10:27 AM | #8 |
Registered User
Join Date: Apr 2011
Location: Klein Texas
Posts: 3,852
|
Re: Any electronics nerds interested in Arduino/Atmel?
Subscribing.
I find that I don't have much time for such endeavors but I have used my arduino and a few lines of code to make a signal generator to diagnosis some engine controller problems I was having.
__________________
My Classics: '72 K20 Suburban + '65 Dodge Town Wagon '72 Corvette Roadster +'67 Corvette Roadster '73 Z-28 Camaro '63 Ford SWB Uni Pickup '50 Ford Coupe |
06-04-2018, 11:14 AM | #9 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
That page is a little deep for me, but it's in the right direction. But it's kinda written for people that already know the answer, I think:
"When we operate transistor as the class A common emitter amplifier usually we choose to bias the transistor (apply voltage on VBE and VCE) in such a way (Q-Point) that IC and VCE (output) will swing to its maximum or minimum value without any distortion (swing into the saturation or cut-off region) when the IB (input) swing to its maximum or minimum value" So that's about where I got lost! But I understand in principle what is happening I think! I'm not really clear on why the diode is needed for inductive loads. Is it because when the inductive field collapses it shoots a voltage spike into the circuit or something? I don't know anything about inductance, unfortunately.
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
06-04-2018, 06:52 PM | #10 | ||
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
Quote:
What he's saying is when we use the transistor as a switch we want to turn it all the way on or all the way off. Quote:
Incidentally, I noticed my truck has a diode across the terminals that attach to the A/C compressor clutch. That would be to reduce or eliminate sparks across the contacts on the compressor switch when it disengages. |
||
06-04-2018, 10:16 PM | #11 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
Thanks for the help so far! I got the "transistor helping to drive a relay" circuit working as you described it above. I added an LED to it as well...
https://www.youtube.com/watch?v=CYKVmS9dIoE Neither the chip nor the relay gets warm, and all seems well! It's not obvious because its out of frame, but the red and black probes go to my 12V power supply and the yellow and green go to the coil leads on the relay, BTW, when I mentioned this to a friend, he said "Why don't you just use a solid state relay"? Will they support 30A?
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible Last edited by davepl; 06-05-2018 at 09:37 AM. |
06-06-2018, 11:30 AM | #12 |
Registered User
Join Date: Aug 2012
Location: Oklahoma City, OK
Posts: 2,611
|
Re: Any electronics nerds interested in Arduino/Atmel?
If you have a Pull-A-Part type place near by, you can salvage relays and sockets from newer cars. The one around here treats them almost as free stuff. A pile of relays and sockets will get counted as one misc $3 part. Your results may vary. One advantage of automotive relays is they usually include either a diode or resistor to suppress the inductive spike of the relay coil. I would still use the added 1n400x diode just to be sure. Hard to have too much spike and noise filtration. Vehicles tend to have lots of electrical noise wondering around. Something about 200+ amps of starter current and 50kv ignition sparks.
Another source for electronics stuff: https://www.jameco.com You should be able to get a 30a solid state relay. |
06-07-2018, 10:44 AM | #13 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
I don't want to rathole on the esoteric, but since I visited the grave of Faraday last week (no joke- I did!) I should probably understand the diode a little better. I know why it's there, but does it happen because charging the coil for the relay magnet creates a magnetic field that collapses and shoots a big spike?
The reason I ask is that it sounds a whole lot like how to ignition coil works, so I'm wondering if it's the same effect. In other news, sadly no pick a parts anywhere near me. Gotta be an hour at least (average bungalow now over $1,000,000 in my area so not a lot of wrecking yard real estate!)
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
06-07-2018, 11:15 AM | #14 |
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
Yes, a spike after the transistor cuts off, you are right. A diode conducts electricity in one direction only, and does not conduct in the other direction. There is an arrow in the diode schematic symbol, that shows the direction current flows from positive to negative. So when the transistor is on and current is flowing from top to bottom in the schematic, the diode doesn't do anything. When transistor cuts off and the coil causes a more positive voltage to appear on the bottom contact of the coil compared to the top contact, the diode conducts to short out the coil and "use up" all the electricity in it.
Incidentally, back in olden days, somebody had to decide when talking about electricity, does it flow from positive to negative, or from negative to positive? In fact they had to decide what is positive and what is negative and what kind of symbols to use to picture it. Physicists have decided it is the flow of electrons in the wire that matters, and those flow from negative to positive. Electrical Engineers decided charges flow from positive to negative, and it has turned out to be the most common way of thinking about how electricity flows. That is a simplified explanation, but the bottom line it it doesn't really matter which flow you follow as long as you don't change your mind in the middle of reading a schematic. :-) |
06-07-2018, 06:50 PM | #15 |
Registered User
Join Date: Aug 2012
Location: Oklahoma City, OK
Posts: 2,611
|
Re: Any electronics nerds interested in Arduino/Atmel?
Bingo on the ignition coil thought. Replace your switching transistor with points and add a secondary HV coil for the spark output and you have it. An ignition coil is a transformer that converts switched DC to HV DC spark output.
A computer controlled car replaces the points with a computer controlling a switching transistor that activates the ignition coil. That's why modern cars have things like crankshaft position sensors, so the computer knows when to fire the coil(s). |
06-08-2018, 11:03 AM | #16 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
Here's my next step - I should have used 3 MOSFETs but only had two on hand, so used three transistors to control the color drive on this LED strip. I also did a MOSFET version for the white LEDs.
So now I've covered transistors, 12V relays, and MOSFETs. I guess all that's left would be solid state relays and 120V relays! https://youtu.be/rcm04NwtjA4
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
06-09-2018, 08:59 PM | #17 |
Registered User
Join Date: Mar 2014
Location: Corvallis, OR
Posts: 715
|
Re: Any electronics nerds interested in Arduino/Atmel?
Subscribing to this too.
I have worked a lot with Arduino stuff, and some with Raspberry Pi. Might be able to help out around here.
__________________
1972 GMC Jimmy Custom 4.8L (L20)/6L90E/NP205 1989 Chevy Suburban V2500 350/Turbo 400/4.11 gears 1996 Chevy Suburban K1500 350/4L60E |
06-15-2018, 09:56 AM | #18 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
Well, as my next step I built a dedicated little board/circuit/computer based around the ESP32 chip. It does the following:
- When it boots up, it connects to the WiFi in my shop - It then connects to the Internet - It sets its clock from a web-based NIST NTP time server - It then runs a web server and waits for requests - When those come in, it measures the temp, humidity, and pressure in the air compressor closet - It reports those in the web page - It displays the current values on a little OLED display right on the chip/board itself For a day or so it'll still be live here: http://1969Pontiac.com:99/ ...and here's a picture of the circuit. I was thinking it could manage the actual compressor if I wanted to go down that path! I might even do so if I can find a "soft start" controller for an AC motor that I can control somehow.
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
06-17-2018, 10:17 AM | #19 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
Does anyone know how I could control:
1) A large cooling fan (like 30A) with a solid state relay or transistor? What could handle that load? A big MOSFET in a can with a heat sync? 2) An AC motor like a compressor? I'd like to soft-start my compressor but again don't know what kind of solid state switch would bear a big 240V compressor!
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
06-17-2018, 12:05 PM | #20 |
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
The annoying thing about heat sinking a power MOSFET is the tab is connected to drain, so that makes the heat sink have live power. So, isolated in a can like you mention would be good, but then you will probably have to circulate air through the can, perhaps with a cooling fan.
Regarding solid state relays, I have read cheap Chinese relays that are sold on Amazon and eBay are mostly counterfeit or fake, and have ratings that are not supported by the actual components in them, and are susceptible to fire or failure. So, I would recommend sticking with a supplier like Mouser, Digi-Key, Sparkfun, or Adafruit. I am thinking a conventional relay may be best for those high currents. |
06-18-2018, 10:17 AM | #21 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
But for a fan or other load that you want to PWM, a mechanical relay doesn't respond fast enough. I know the Ford Taurus had a solid state fan controller, as does my 2015 Corvette, but I'd like new parts (not junkyard harvest if I can help it!).
Naive question - on the case being drain, does that change if its PNP rather than NPN? Summit and Amazon carry a Hella relay that is solid state but appears to fit the conventional form factor and will handle 32A per unit: https://www.summitracing.com/parts/h...SABEgIYEvD_BwE So I could have three of those oboard: 1) Cooling Fan A 2) Cooling Fan B 3) Fuel Pump (duty cycled down below 2000rpm for example)
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible Last edited by davepl; 06-18-2018 at 10:28 AM. |
06-18-2018, 12:09 PM | #22 |
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
Yes, true if you’re thinking about PWM a conventional relay won’t work. For something simple like switching from parallel to series would work with conventional relay.
That Hella relay looks like just the thing to use. With MOSFETs they call them N-channel or P-channel instead of NPN or PNP but the concepts regarding application are similar. Both N-channel and P-channel mounting tab are connected to the drain. That relay looks interesting, I wonder if that is a plasti-kote kind of insulating paint on the heatsink. |
06-20-2018, 12:55 PM | #23 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
I don't know if it's the right choice, but here's what I ordered to run my compressor:
https://www.mouser.com/ProductDetail...Qgm8BEGA%3D%3D The compressor motor says 21A and that SSR is good for 30A. I watched a few disassembly videos on discount 30A SSRs that are on Amazon and eBay right now and they're made using as 12A triac! So the triac is only rated for about 1/3 of the total device... so I bought a quality USA unit instead. I'm hoping I can do PWM and slow-start the compressor motor with this, we shall see. I know I learned that most SSRs are actually "zero crossing" and don't change strate until the AC waveform crosses zero. So I ordered this one that is supposed to be instant. I would have preferred someone made a "Large single phase AC motor speed controller" that I could just send a reference voltage and it did the work, but I couldn't find anything like that!
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
06-20-2018, 08:02 PM | #24 |
Senior Member
Join Date: Apr 2016
Location: Cypress, TX
Posts: 3,859
|
Re: Any electronics nerds interested in Arduino/Atmel?
Well I don't know about PWM for AC, I think it is for DC motors only, but I may be mistaken. It will be interesting to find out how it goes.
|
06-21-2018, 12:06 PM | #25 |
Registered User
Join Date: Aug 2006
Location: Redmond, WA
Posts: 6,332
|
Re: Any electronics nerds interested in Arduino/Atmel?
I know... if I could time it to the 60Hz waveform precisely, I could turn it off an on for one waveform cycle at a time, but I'm going to be kicking it in PWM no matter where the waveform is right now.
In theory, it should work. But I have about as much theory as Benjamin Franklin...
__________________
1970 GMC Sierra Grande Custom Camper - Built, not Bought 1969 Pontiac 2+2 427/390 4-speed Coupe 1969 Pontiac 2+2 427/390 4-speed Convertible |
Bookmarks |
Thread Tools | |
Display Modes | |
|
|