Controling a 9v supplied CMOS with Arduino's 5v

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?

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.

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

Could I use 2 NPN or even a NPN Darlington?

Well, you could put in a row :slight_smile:
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))

I tried your 2 examples but it did not work.....all I got was about 4v? In both cases? :~

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.

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.

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.

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! :disappointed_relieved:

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.

Thanks for reminding me about HIGH vs LOW. Hi keep thinking ON vs OFF. :blush:

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

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

Good lock with the snow!

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.

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!

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

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?

Well,
The pins are comparable to say 20K resistors. The 100K resistor will limit the current from the 9V source to 0.09mA, so the output would be like 1.8, so that could be okay.

OK this is almost working......but I'm only getting 5.5v at the gate? I guess the 100k pullup resistor is to big? How low can I make the pullup resistor to get more voltage but not harm the Arduino pin?

Soooooooooooooo close!