Using 5v To turn on 12v supply? (ATtiny in car use)

Using and Programming Arduino and other microcontrollers
Almurray42
Competent
PostsCOLON 293
JoinedCOLON Wed Jun 30, 2010 11:42 pm
LocationCOLON Bridgwater, Somerset, England
CONTACTCOLON

Using 5v To turn on 12v supply? (ATtiny in car use)

Postby Almurray42 » Mon May 21, 2012 12:23 am

Hi guys, This is a tricky one that has me confused!

Basically I have used my arduino to program a little ATtiny85 that turns On/off Supply to a pin (LED's to be attached) With the function of being able to adjust the brightness by holding the button down (As explained in getting started with arduino book example 5).

I have it all working to the stage where I can turn on and off and vary brightness of some 3v led's without the use of resistors, BUT I designed the circuit for use in my car where I wanted to use 12v LED strips. The input voltage for the ATtiny is 3.2 - 5.5 V so I will have to use a voltage regulator to limit that (I forgot how to do this exactly to what I need! :P) . The problem arises where I am not sure if it is possible to effectively Upscale the voltage from the pin to 12v (Whilst still being able to adjust voltage to vary brightness) Or to use the ATtiny's output to effectively switch on and alter the 12v supply seperately.
I think it may be possible with some kind of transistor but this one truly has me confused!

That probably sounded like a load of nonsense so I professionally made up a BS8888 Standard Engineeirng drawing for you below ;) (The wonders of paint! :P)

Image

I would greatly appreciate any help you could give me... I'm truly stuck! :D

Thankyou and happy modding!
┬ČAl

EDIT: I just noticed I forgot to connect the other pin of the Button to the +VCC on my expert diagram hahaha, assume it is connected :P
Image
[MOD IT] [OR BIN IT]

The Crusher
Above Average
PostsCOLON 84
JoinedCOLON Wed Mar 07, 2012 7:59 pm
LocationCOLON Norway
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby The Crusher » Mon May 21, 2012 10:37 pm

Hi,

I understand that your problem is that you need 12V and the ATtiny only gives out 5V? If so, I got some solutions.

1. Use a transistor. Connect the ATtiny output to a 10K ohms resistor and the resistor to the base on the transistor. Let the GND go trough the transistor, does not remember the name on the pin right now. This is a small solution, cheap and silent.

2. Use a 5V relay. Controll the relay with the ATtiny, and connect 12V to one of the switches on the relay. If you want a relay that makes no noise, buy a solid state relay. They are electronic relays, and not mechanicly. They cost more than a transistor, is bigger but still a solution.

Hope this helps :)
Current project: The Orange
| HK: Gigabyte 990FXA-UD5 | CPU: AMD Phenom II X6 1055t | GPU: Gainward GTX 470 |
| RAM: Corsair Vengeance 16GB 1600MHz DDR3 | PSU: Corsair AX 850w | SSD: Crucial m4 128GB |

Almurray42
Competent
PostsCOLON 293
JoinedCOLON Wed Jun 30, 2010 11:42 pm
LocationCOLON Bridgwater, Somerset, England
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby Almurray42 » Mon May 21, 2012 10:50 pm

Yes! I managed to find a very long winded way of posting it haha!
Thankyou so much! This Really helps haha!
I have some NPN 2N3904 (Or something similar) transistors, any Idea if these will work?
I know there are different variations of the pin layouts so I found a pic for the different cases. Not sure which one it will need though!
Image
Image
[MOD IT] [OR BIN IT]

The Crusher
Above Average
PostsCOLON 84
JoinedCOLON Wed Mar 07, 2012 7:59 pm
LocationCOLON Norway
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby The Crusher » Mon May 21, 2012 10:58 pm

Good to hear that i can help :)

I dont remember the difference on NPN and PNP. I have only used PNP, but it might work with NPN too. I can ask my teacher in the subject computers and electronics tomorrow if i see him :)
Current project: The Orange
| HK: Gigabyte 990FXA-UD5 | CPU: AMD Phenom II X6 1055t | GPU: Gainward GTX 470 |
| RAM: Corsair Vengeance 16GB 1600MHz DDR3 | PSU: Corsair AX 850w | SSD: Crucial m4 128GB |

Almurray42
Competent
PostsCOLON 293
JoinedCOLON Wed Jun 30, 2010 11:42 pm
LocationCOLON Bridgwater, Somerset, England
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby Almurray42 » Mon May 21, 2012 11:03 pm

The Crusher wroteColonGood to hear that i can help :)

I dont remember the difference on NPN and PNP. I have only used PNP, but it might work with NPN too. I can ask my teacher in the subject computers and electronics tomorrow if i see him :)


Me neither! :P I'll have another web browse, and I will be doing the same for my Electrical And Electronic Principles Teacher tomorrow haha! Thanks again! :)
Image
[MOD IT] [OR BIN IT]

The Crusher
Above Average
PostsCOLON 84
JoinedCOLON Wed Mar 07, 2012 7:59 pm
LocationCOLON Norway
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby The Crusher » Mon May 21, 2012 11:06 pm

No problem Al :) just ask if it is more electronics you need help with! :)

Edit: you can read about transistors here: http://www.kpsec.freeuk.com/trancirc.htm
Current project: The Orange
| HK: Gigabyte 990FXA-UD5 | CPU: AMD Phenom II X6 1055t | GPU: Gainward GTX 470 |
| RAM: Corsair Vengeance 16GB 1600MHz DDR3 | PSU: Corsair AX 850w | SSD: Crucial m4 128GB |

The Crusher
Above Average
PostsCOLON 84
JoinedCOLON Wed Mar 07, 2012 7:59 pm
LocationCOLON Norway
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby The Crusher » Thu May 24, 2012 11:33 am

Hi again.

I made a schematic for you. :) I have not included voltage regulator for 5V in to the ATtiny.. There is a NPN transistor. The resistor you need is about 10kohms..
You do not have the required permissions to view the files attached to this post.
Current project: The Orange
| HK: Gigabyte 990FXA-UD5 | CPU: AMD Phenom II X6 1055t | GPU: Gainward GTX 470 |
| RAM: Corsair Vengeance 16GB 1600MHz DDR3 | PSU: Corsair AX 850w | SSD: Crucial m4 128GB |

Almurray42
Competent
PostsCOLON 293
JoinedCOLON Wed Jun 30, 2010 11:42 pm
LocationCOLON Bridgwater, Somerset, England
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby Almurray42 » Fri May 25, 2012 11:08 am

The Crusher wroteColonHi again.

I made a schematic for you. :) I have not included voltage regulator for 5V in to the ATtiny.. There is a NPN transistor. The resistor you need is about 10kohms..


Thankyou So much! I'll Try this out later on this evening :)
Much appreciated!
Image
[MOD IT] [OR BIN IT]

The Crusher
Above Average
PostsCOLON 84
JoinedCOLON Wed Mar 07, 2012 7:59 pm
LocationCOLON Norway
CONTACTCOLON

Re: Using 5v To turn on 12v supply? (ATtiny in car use)

Postby The Crusher » Fri May 25, 2012 2:46 pm

No problem Al :) just ask me if you need more help :)

Going to do the same, only with dc motors and solid state relays. Can try with transistors too :)
Current project: The Orange
| HK: Gigabyte 990FXA-UD5 | CPU: AMD Phenom II X6 1055t | GPU: Gainward GTX 470 |
| RAM: Corsair Vengeance 16GB 1600MHz DDR3 | PSU: Corsair AX 850w | SSD: Crucial m4 128GB |


Return to

Who is online

Users browsing this forum: 1 and 0 guests