electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Arduino
Using arduino like a 4066 or 4016 CMOS chip
Post new topic   Reply to topic
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
cslammy



Joined: Apr 27, 2018
Posts: 66
Location: USA

PostPosted: Fri Aug 24, 2018 3:03 pm    Post subject: Using arduino like a 4066 or 4016 CMOS chip Reply with quote  Mark this post and the followings unread

Hi there, stumbled upon this while completing my arduino based synthDVM module.

I imagine experienced arduinoers have seen this before but I hadn't.

Use digital pins as High-z or ground, and then hook that to op amps to pass or crush analog signals.

I put a post about how this works on my blog

For me it turned the arduino into a cool 4016/4066 like audio switching beast, but without having to worry about on resistance or how high z the high z is.

Hope someone else finds this useful. Thanks!

_________________
please visit my audio blog and website
Back to top
View user's profile Send private message Visit poster's website
PHOBoS



Joined: Jan 14, 2010
Posts: 4088
Location: Moon Base
Audio files: 605

PostPosted: Sat Aug 25, 2018 6:26 am    Post subject: Reply with quote  Mark this post and the followings unread

If I understand correctly it is actually the opamp you are using as the switch not the arduino, though it is needed as it can change the impedance of
its pins. This should also be possible with a transistor and I think that way you could make a switch that can handle bipolar voltages with a wider
range than a standard 4016/4066. Neat trick, might come in useful some day Very Happy

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22567
Location: The Netherlands, Enschede
Audio files: 220
G2 patch files: 319

PostPosted: Sat Aug 25, 2018 6:49 am    Post subject: Reply with quote  Mark this post and the followings unread

Possible with a transistor, yes, basically switching between low (pin is output and low) and HiZ (pin is input) makes the pin an open drain output (open collector for a transistor) .. so yes .. it makes it behave like a transistor where the collector is left open.

This also allows for limited level shifting of signals as the high level is determined by the voltage the external resistor is getting (it can not go over the supply voltage of the processor (or actually its maximum input voltage, which sometimes is higher than the supply voltage)) but it can be lower (but not below zero)).

The drawback is that this tends to get a somewhat slow(ish) switching behavior, as the external resistor will limit the maximum current to flow into the pin (and wire) capacitance.

_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
cslammy



Joined: Apr 27, 2018
Posts: 66
Location: USA

PostPosted: Sat Aug 25, 2018 4:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:
If I understand correctly it is actually the opamp you are using as the switch not the arduino, though it is needed as it can change the impedance of
its pins.


Hi PHOBoS: you understand correctly.

using a transistor to clobber an op amp, with or without an Arduino controlling its base, is interesting. I'll mess with that on the bench. Thanks!

_________________
please visit my audio blog and website
Back to top
View user's profile Send private message Visit poster's website
AlanP



Joined: Mar 11, 2014
Posts: 525
Location: New Zealand
Audio files: 32

PostPosted: Sat Aug 25, 2018 11:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

What kind of distortion or filtering would you get, if the transistor had some kind of CV input, and not a digital signal?
Back to top
View user's profile Send private message
cslammy



Joined: Apr 27, 2018
Posts: 66
Location: USA

PostPosted: Sun Aug 26, 2018 12:08 pm    Post subject: Reply with quote  Mark this post and the followings unread

Apologies in advance for this wordy response.

I am going to try to experiment with this on my bench but first let's see if we can agree on what's being discussed. Please See this quicky drawing.

Is this what we're talking about?

--The collector of the transistor is soldered to the 30K and 10K voltage divider
--The emitter has a 1K resistor to ground so you don't burn up the transistor.
--The op amp is whatever, a TL071 for instance.
--Power for the op amp is +/- 15V, so you can pass an analog signal through it, or kill it.

OK here's where it gets interesting: Question:

--by energizing the transistor base, the question is, does it kill off any signal flowing out of the opamp to whatever is next (I'd probably use a dual op amp and buffer this signal?).

What I suspect:

if you can energize the base enough to bring the collector down to ground, it should. It clobbers the output of the op amp, without heating anything up/killoing things/magic smoke.

If you leave the base alone, the op amp output isn't affected. The world is a happy place.

For me, This worked when the transistor was a digital out of an Arduino nano. You have to flip pin mode from INPUT to OUTPUT/LOW but you're doing the same thing as a transistor would do.... I saw this with my own eyes.

So I think yes, if an Arduino works, a transistor should work as well.

So: Does it work with the transistor instead? it's worth messing with. I don't think I've seen this circuit fragment used a lot but then I don't do this analog electronics thing as much as most of you other forum members do.


Alan P: I don't think the type of signal you feed the opamp or the transistor base matters. To kill whatever is going through the opamp, you send current through the base of the transistor, and this current can be supplied by a "digital" as long as there enough current to drive the transistor into saturation, so we assume digital "on" is greater than .7 or so V relative to ground and can source some current--You do have to kick some current through the transistor base to emitter to ground, but not much.

Or, whatever feeds the transistor base can be analog--an audio signal that's over .7V relative to ground? A CV from another output that has a 1K resistor in series? Output of another op amp? Whatever. It shouldn't matter, whatever will make the collector go to ground should work.

I apprecaite Phobos' idea--if the tranny works that's a really easy way to switch analog signals on and off. Someone should screw around with this?

Or maybe I'm no longer following this thread?

If anyone wants to try it out, let me know if it works. I would normally use a 4066 for this but to me this seems more analog and I do computers all damn day otherwise. Smile Thanks for reading.


ompamp2.PNG
 Description:
 Filesize:  737.75 KB
 Viewed:  11 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

ompamp2.PNG



_________________
please visit my audio blog and website
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic
Page 1 of 1 [6 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Arduino
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use