Pages: [1] 2   Go Down
Author Topic: Controling a 9v supplied CMOS with Arduino's 5v  (Read 2942 times)
0 Members and 1 Guest are viewing this topic.
Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK I'm building a guitar effect switch box using Arduino. The CMOS I'm using are CD4066.

So there is no clipping/distortion in the signal I need to feed the CMOS with 9v.(Not a problem so far.) But to trigger the gate of 9v supplied CD4066 I need 6v min (That is my problem!)

I was thinking of using this method to get higher voltage (arduino.cc/playground/uploads/Learning/solenoid_driver.pdf)

But I'm not driving a 3 amp motor ....... I just need to tap into the 9v.

So I would control the transistor with the Arduino pin and feed the CMOS gate with the 9v controlled by the transistor. Make sense?

I there a better way? What transistor would you recommend?

I was also looking at CD4050 but they would bring my 9v to 5v right? Not my 5v to 9v? I think?
« Last Edit: January 31, 2011, 09:19:02 am by alparent » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23736
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, the open-collector driver will interface the arduino to the CMOS nicely.
Just remember that transistor (2N2222 will work nicely) will be acting as an inverter (1 from Arduino will put out low voltage going to the CMOS gate). I did the same thing when I needed to make an inverter and didn't want to use a whole 7404.
You will need a resistor between arduino and the gate pin to limit the arduino output current, and from the 6V/9V source to the transistor collector to limit current flow thru the transistor. I used 10ks for both.

Couldn't get ti.com to open a datasheet for the other part. The general description does sound like it is intended for bringing signals down to TTL level.


* inverter.jpg (35.62 KB, 960x720 - viewed 70 times.)
« Last Edit: January 31, 2011, 09:59:36 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply.
But what if I didn't want inverting?

Could I use 2 NPN or even a NPN Darlington?
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23736
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, you could put in a row :-)
Or try it this way, with a non-inverting emitter follower.
When the transistor is off, the output is pulled low by the resistor.
When the transistor is on, Vout will equal ~(Vsource-Vtransistor (0.5-0.7V))


* emitter_follower.jpg (34.65 KB, 960x720 - viewed 43 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried your 2 examples but it did not work.....all I got was about 4v? In both cases? smiley-confuse
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23736
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What transistor are you using? We can do some math and come up with better resistor values.
10K worked for me as I didn't need much signal change to with high & low for the arduino.
You could try 1Ks for now.
I won't have much time to look at this today, we're in the middle of a snowstorm, got 3-4" already, another 4"+ coming, then more over night and thru tomorrow, 16-20" total when done.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used a 2N3904. Tried with a 10 ohm resistor and killed the transistor and burnt my finger!

20 inches of snow........ you should hook up a Arduino to a snowblower!

I will check if I have any MOSFET at home tonight and try that. Will also try NPN with other values.

Thanks for your time.

Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23736
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

10 ohm, yeah that is way too small.
With 9V, I don't think you want any smaller than 470 ohm to limit current flow:
(9v - Vce)/(current limit R) = (9-0.3)/470 = 18.5mA.
CMOS inputs are really voltage driven, so you don't need to switch a lot of current.
Then you could make resistor between arduino and the base around 1K, will turn the transistor on full but current flow will be limited to safe region for the part by the 470.

Now they are saying sleet to finish off the storm tomorrow. Total forecast dropped some to 16", with sleet to end it.
I don't have independently controllable wheels on my snowblower, so not really arduino capable.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK I tried this again with my 2N3904

Using the inverted setup I get 8v (my battery is weakening).
But using the buffered setup I steel get only 4v.

So if I use the inverted setup I'm good....just have to change my code. Right? No! 'cause now I have to take my indicator LED from the Arduino pin ('cause now the PIN is LOW when the CMOS gate is ON) so I have to move the LED to the some source that feeds the CMOS gate ...... and that brings me back to 4v!!!!!!
Man this is complicated!  smiley-sad-blue
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23736
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can turn the LED on by sourcing 5V from arduino thru resistor to Anode, cathode to ground. Turns on when Pin is high.
Or, 5v to resistor to Anode, cathode to Arduino pin, turns when pin is low.
Easy to do either way.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 Thanks for reminding me about HIGH vs LOW. Hi keep thinking ON vs OFF.  smiley-red

Is the 4v with the buffered setup normal?
Would a MOSFET change anything?

Last question........(for tonight  smiley)
Could JFET be used? I have A LOT of 2N5457. If so ........ how would I hook them up?

Good lock with the snow!
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23736
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Snow not bad so far, 7, maybe 8" of fairly light stuff.
More coming tomorrow, that will be the messy stuff.

You could try something like this. Resistors selected to limit current to 9mA.  I've not tried hard switching of what is basically an audio transistor, you may have to play with the values some.



* JFET_buffer.jpg (17.92 KB, 613x287 - viewed 31 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for that.

What about using a PNP instead of a NPN (2N3906 instead of a 2N3904)
Would that change anything?

I'm also in a snow storm.....started this morning.....expected 15 inches......thank God for snow blowers!
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 439
Posts: 23736
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think PNP would work - look at this for an example.
http://www.mayothi.com/transistors.html
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Someone from my effect building forum suggested this solution:

1 - Connect Arduino pin to CMOS gate
2 - Pullup the 9v to that gate using a 100k resistor
3 - Set Arduino pin to input
This turns CMOS gate on

4 - Set Arduino pin to Output LOW
This sets CMOS gate to 0v = Off

What do you think?
Is it safe for the Arduino?
Dose it make sense?
Logged

Pages: [1] 2   Go Up
Jump to: