So now you have 3 circuits to chose from.
1K0 resistor??
Yes and i choose the last one
1000 Ohm, long time ago with photocopy machines 1.0K might not have the . printed because of its size and paper quality.
So 1K0 = 1,000 Ohms, 1M0 = 1,000,000, 4K7 = 4,700 OHMS, 1R1 = 1.1 Ohm.
The multiplier became the decimal point.
It still continues today with us "elder Statesmen".. ![]()
Tom....
![]()
I would use my circuit or grumpy_mike's. If you plan on using the 2N7000, then the last one is wrong.
But even with 10k it still okay right?
Can you explain to me what is wrong with it??
The transistor pin out is wrong.
Look at the 2N7000 then look at the diagram.
Better to use a 1N4148 as clamping diode to VCC instead of a 5volt zener.
And did we think about cross-talk between mux channels.
We need some pull up on the drains. Internal pull up on A0 isn't going to cut it.
Leo..
Hmm can you give me like the diagram for it?
and for the cross-talk between mux is it enough by just connecting the unused mux channel to gnd?
i dont think so, because i connect it just like the post#2 did by @Grumpy_Mike
Don't know, never seen a finished piezo drum project.
Not sure about the need for the mosfets either.
The 74HC4067 seems to have protected inputs to 20mA. A piezo could never create that current.
I would try connecting a few piezos directly to the mux first, and see what you're getting. Do use 1Meg resistors across each piezo. Their function is to bleed any gnerated voltage of the piezo capacitance to ground, for a solid LOW when idle.
If you want fast attack, then you also need to select the piezos for positive pulses when struck. Common 1" piezo disk can have a random phase.
Leo..
Here is a sketch I wrote for a HC4067
const byte controlPin[] {4, 5, 6, 7}; // control pins s0-s3
int muxValues[16];
void setup() {
Serial.begin(115200);
for (byte i = 0; i < 4; i++) pinMode(controlPin[i], OUTPUT);
}
void loop() {
// read
for (byte i = 0; i < 16; i++) { // 16 channels
for (byte s = 0; s < 4; s++) digitalWrite (controlPin[s], bitRead(i, s));
//muxValues[i] = analogRead(A0); // dummy read, if needed
muxValues[i] = analogRead(A0); // 0-15
}
// print
for (byte i = 0; i < 16; i++) {
Serial.print(muxValues[i]);
Serial.print(",");
}
Serial.println();
delay(250); // human readable
}
hmm okay, thanks for your suggestion, i think i will use that code to test the multiplexer. ![]()
[/quote]
Make sure you control the right pins: is it 2, 3, 4, 5 or 4, 5, 6, 7 ?
Oh yeah i will change it into 2, 3, 4, 5
thanks for reminding me btw ![]()
Well considering that every schematic you have posed so far is wrong, I suspect that whatever you have now is probably also wrong.
Not sure why you decided to use the MOSFET circuit, since now you will need to change your code to work with it.
I think, in the end with all the changes you have made, you are going to wind up with something that does not work.
Hi,
What I think most are forgetting is that even a small piezo is capable of generating 100's of volts, admittedly it is from a relatively high impedance source, but enough to punch through a MOSFET gate.
So 1M0 in parallel and some clamping diodes is good practice.
Tom....
![]()
Hii,
Yeah i will also use 1M resistor
i was confused back then.
im still using this diagram you gave me
Hi, @morishima_kureo
Try the 10K, if it doesn't work then try the 1K for the series gate resistor.
You are building this on a breadboard of some type?
Tom....
![]()
Hi @TomGeorge
yes im building this on breadboard, i will try the 10K first
thanks for your help!