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.

Could use checking of my schematic for Teensy Audio Shield pcb

TonyAme

New Member
I'm working on a pcb for the Teensy Audio Shield (4.x Rev. D) with the Teensy 4.0.

Just breaking out for some pots and audio output circuit. I connect CdS photoresistive cells to the Analog Input lines, whose resistance values can be added by way of spdt switches (with the pots). The CdS sensors will be connected via RCA mono female jacks.

The Teensy plus Audio Shield are powered by 5V regulated, there is a p-channel MOSFET used as polarity protection. The Pots use the +3V output supplied by the Teensy.

Just needing some fresh eyes to look this over, as I often miss things after looking at the circuit for so long. Any comments, advice, suggestions welcomed.

If anyone finds this circuit useful please feel free to use.
Sincere Thanks,
TonyAme
Schematic_TeensyAudioFilter_2_2024-02-28.png
 
nothing major , just Cap RefDes err. around LDO and C1~4 values TBD

add TP# if you want for test points or a flashing heartbeat LED if you have the code.
 
nothing major , just Cap RefDes err. around LDO and C1~4 values TBD

add TP# if you want for test points or a flashing heartbeat LED if you have the code.
Sincere thanks for checking this over. I'm still learning so I'm not completely familiar with some of the terminology you use in your reply.

Cap RefDes err around LDO, does this mean the capacitors connected to low drop out voltage reg?

C1-4 values TBD?

Thanks for helping me out.

I'm also trying to figuare out how to add somekind of voltage protection for the analog input pins of the microcontroller. I will be using 10k pots, but also adding CdS photoresistive sensors to each pot, so I think I need to add some kind of voltage protection on each analog pin. Any suggestions would be greatly appreciated.

Sincere Thanks,
TonyAme
 
Cap RefDes err. around LDO

= means The Reference Designations are in error for the LDO which do not match the listed parts.
see my marked up schema.

C1~4 values TBD
- means no values given or "to be determined" TBD

Since you have not defined the analog inputs, I don't know what protection is needed. What does the datasheet expect for max inputs must be provided by suitable diode clamps and series current limiting resistors that will not exceed those limits with some margin for tolerances.
 
Last edited:
Having the sockets J9-J12 directly connected to the pot wipers is really bad.

If the pot is at maximum (so the wiper is connected to 3.3V) any low resistance load or short on the socket will short the 3.3V supply.

You need to rethink that part.
eg. You could just add a1K resistor in series with the 3.3V to each pot, so at maximum it's still current limited. Just rescale the ADC range slightly.

For ADC input protection, put a low value resistor (470R?) in series with the pin, move the filter cap to the pin side the resistor & add two schottky diodes from the pin to 3.3V and ground, with cathodes towards the 3.3V supply. They will limit any over or undervoltage.
 
Having the sockets J9-J12 directly connected to the pot wipers is really bad.

If the pot is at maximum (so the wiper is connected to 3.3V) any low resistance load or short on the socket will short the 3.3V supply.

You need to rethink that part.
eg. You could just add a1K resistor in series with the 3.3V to each pot, so at maximum it's still current limited. Just rescale the ADC range slightly.

For ADC input protection, put a low value resistor (470R?) in series with the pin, move the filter cap to the pin side the resistor & add two schottky diodes from the pin to 3.3V and ground, with cathodes towards the 3.3V supply. They will limit any over or undervoltage.
Thank you for this input. Been researching ways of protecting the analog input, as you have mentioned with diodes.

I'm using 10k Ohm pots. I think I should consider the diode solution, to protect over AND under voltage as you said. Does it matter what kind of Schottky diode? I've never used those in a circuit before.

Some info I found:

analogInputProtection_diodes.png


And from mosiac-industries website.
schottkyDiodeProtection.png
 
Thank you for this input. Been researching ways of protecting the analog input, as you have mentioned with diodes.

I'm using 10k Ohm pots. I think I should consider the diode solution, to protect over AND under voltage as you said. Does it matter what kind of Schottky diode? I've never used those in a circuit before.

Some info I found:

View attachment 144779

And from mosiac-industries website.
View attachment 144780

Generally micro-controllers already have built-in diodes on the I/O pins, for this exact reason. You should however, add series resistors to limit current through the diodes, either the internal ones, or external ones if you add them.

As has already been mentioned, the external inputs shouldn't connect directly to the sliders of the pot's.
 
Generally micro-controllers already have built-in diodes on the I/O pins, for this exact reason. You should however, add series resistors to limit current through the diodes, either the internal ones, or external ones if you add them.

As has already been mentioned, the external inputs shouldn't connect directly to the sliders of the pot's.
Thank you. Yes, I've been thinking of just using series resistors as you suggest. Thanks for the input.
 
I think this might be one valid solution for protecting an analog input from over and negative voltages. Analog input pin (pin 17). Just need to determine the values of the Schottky diodes to use. (The jack J11 will receive a CdS resistive photosensor whose resistive value would be added to that of the pot VR3, (when switched on by S3). C3 is a ceramic 0.1uf cap.

I could omit the Schottky diodes, however, I will make them optional in order to see the difference in the circuits behavior, with and without diodes.
SchottkyDiodeResistorProtection.png
 
There should be no difference in the circuits behaviour, as they have no function UNTIL you try and provide too much voltage to the input.
That would be great. I did read about the diodes adding some capacitance? The 470 ohm resistor would be easy to adjust for in code, I hope.
Thanks.
 
That would be great. I did read about the diodes adding some capacitance? The 470 ohm resistor would be easy to adjust for in code, I hope.
Thanks.
The 470 ohm should make no difference, and I would prefer to see it higher - although I'm not sure what the input spec. of your processor is?.

The main issue is that there's only one A2D in the processor, and that is switched between the different inputs - and as you switch the internal sample and hold capacitor has to charge/discharge to the new voltage level. If you switch too quickly the capacitor doesn't have time to charge/discharge fully (dependent on the source impedance), and you get incorrect readings.
 
You still have short circuit path through the LDR socket and pot.....

If the pot is set all the way to the VCC end, anything connected to the socket is directly across the power supply.

Something will be shorted and damaged.

That needs re-arranging.
 
You still have short circuit path through the LDR socket and pot.....

If the pot is set all the way to the VCC end, anything connected to the socket is directly across the power supply.

Something will be shorted and damaged.

That needs re-arranging.
Should there be a limiting resistor between the voltage side of the pot and 3V?
Should a still include a resistor in series with the analog line?
 
Should there be a limiting resistor between the voltage side of the pot and 3V?
Should a still include a resistor in series with the analog line?

You should ALWAYS include a resistor in series, to limit current through the protection diodes. Bear in mind, if the input is above Vdd the internal protection diode will bypass the voltage to the Vdd rail, but with the tiny amount of current PIC's often use that voltage could exceed the safe voltage for the PIC. Also, if you remove power to the PIC, it could continue running is a voltage is connected to the analogue input.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top