Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using BJTs to switch input to a sensor

Status
Not open for further replies.

Zebranky

New Member
Hey, all. I'm trying to use two BJTs to switch between two LDRs (8k-135k) as input to an Arduino, as below (R3 and R5 are LDRs, analog input connects at node 4):
**broken link removed**

However, the voltage at the digital output has a significant impact on the voltages at the LDR voltage dividers, and so on the output. What am I missing here that's interacting with those? I assume it has to do with the load that the BJTs are placing on the voltage dividers, but I'm not sure how to mitigate that.

Any other thoughts on the design (especially choice of resistor values; most were pulled out of my rear) would be appreciated, with a couple caveats:
1) I could do this easily with MOSFETs, but I have a ton of small BJTs lying around, and I figure I should use them for something.
2) I do need to use the digital out to switch between two LDRs, because ultimately there will be 8 LDRs and only 4 analog inputs.
 
Hey, all. I'm trying to use two BJTs to switch between two LDRs (8k-135k) as input to an Arduino, as below (R3 and R5 are LDRs, analog input connects at node 4):

However, the voltage at the digital output has a significant impact on the voltages at the LDR voltage dividers, and so on the output. What am I missing here that's interacting with those? I assume it has to do with the load that the BJTs are placing on the voltage dividers, but I'm not sure how to mitigate that.

Any other thoughts on the design (especially choice of resistor values; most were pulled out of my rear) would be appreciated, with a couple caveats:
1) I could do this easily with MOSFETs, but I have a ton of small BJTs lying around, and I figure I should use them for something.
2) I do need to use the digital out to switch between two LDRs, because ultimately there will be 8 LDRs and only 4 analog inputs.

hi,:)
I know its not a direct answer to your post, but are you aware of the analog ic's HEF4051 HEF4052 HEF4053 etc... they are ideal for this type of analog selection.
 
hi,
This is what a LTspice sim shows for your circuit, as you already know, it has problems.:)
 

Attachments

  • AAesp02.gif
    AAesp02.gif
    28.1 KB · Views: 282
Thanks for prompting me to look at ICs -- I think the CD4016 or CD4066 would be perfect here. That said, I'd still like to know what I'm doing wrong so I can understand BJTs better.

Edit: No, not quite... a CD40[16]6 with a dedicated output pin for each switch would be ideal. The HEF4053 is exactly right, except it only has three switches. Could always get two, but...
 
Last edited:
Thanks for prompting me to look at ICs -- I think the CD4016 or CD4066 would be perfect here. That said, I'd still like to know what I'm doing wrong so I can understand BJTs better.

Edit: No, not quite... a CD40[16]6 with a dedicated output pin for each switch would be ideal. The HEF4053 is exactly right, except it only has three switches. Could always get two, but...

hi,
Look at this image, shows the voltages for either ON state, you can see the imbalance.
For reference, there are more analog selectors available.

You should be able to see the problem you have with biassing.:)
 

Attachments

  • AAesp03.gif
    AAesp03.gif
    25.8 KB · Views: 280
I don't recall seeing LDR's used as current sources for a BJT. I always use them in the base circuit to switch the transistor on or off as the light level demands. Maybe I'm learning something here.

I suppose it would be easy with mosfets, but a BJT is a different animal with different requirements.

FWIW.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top