[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.2496250 [View]

bump

>> No.2475383 [View]

>>2475335
It's like a vest he wears isn't it?

>> No.2475318 [View]

>>2475314
Damn you got me too.

>> No.2454882 [View]

>>2454786
Good to know, I have a few of these around, but need a 24v one.

>> No.2440605 [View]

>>2440332
yeah but living in any western country is.

>> No.1986617 [View]

>>1986359
Interesting. I had a similar problem, someone cut the bottom of two trusses in my attic because they were so fucking stupid they didnt try turning the whole house fan housing the other way.

Anyway, I cut kiln dried 2x6 (same as truss) to a just in contact fit to fill the gap, and then put two more on each side and extended past the damage 3 feet on each side and put a 5/8 bolt through every foot.

I thought the high clamping force flofball those bolts squeezing the 3 pieces together would be enough to restore strength.

You say no, it doesn't do shit?

>> No.1769017 [View]

>>1768855
> the upshot is that you just need to read that bit of data before you start clocking

Oh man, yeah that works, cheers. I mean, that's annoying but it works!


void loop() {
int data1 = 0;
int data2 = 0;
int data3 = 0;
int data4 = 0;

int first = digitalRead(_CD4021B_dataPin);
digitalWrite(_CD4021B_latchPin, LOW);
data1 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data2 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data3 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data4 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
digitalWrite(_CD4021B_latchPin, HIGH);

if (first || data1 || data2 || data3 || data4) {
Serial.println(first, HEX);
Serial.println(data1, HEX);
Serial.println(data2, HEX);
Serial.println(data3, HEX);
Serial.println(data4, HEX);
Serial.println("========");
delay (300);
}
}

>> No.1768372 [View]

>>1768362
On the assumption P/~S is the parallel/serial control - I'm only reading when the P/S-C (latch pin in the code above) is low so I don't think that's the issue.

>> No.1768370 [View]

Right, I'm a bit of a noob so
>>1768358
>>1768362
Shouldn't both of these be covered by the arduino's shiftin function, unless I screwed up the pins? If not, can you please elaborate?

>> No.1768306 [View]

>>1768298
> How are you timing your latch signal with respect to your clock signal?
What you see is it - shiftIn is an arduino builtin function for working with the CD4021B.

Tried those suggestions, no dice.

> I didn't know you could do that kind of weak typing.

As far as I know, it's basically C.

>> No.1768293 [View]

>>1761209
I've worked out that the shiftin seems to offset the bits by one. So, with the following code it means that the switch on PI-1 (pin 7) should be the most significant bit 0x80, but it is read in as the second most significant bit 0x40. It also means that the switch on PI-8 (pin1) is supposed to be the least significant bit, but is read as the most significant bit on the next IC in the chain.

My first thought was an issue with clock speed, but it behaves the same way with only one of the ICs attached to the board. Otherwise, I have no idea what the issue is. Any thoughts?

<code>
int _CD4021B_dataPin = 5;
int _CD4021B_clockPin = 6;
int _CD4021B_latchPin = 7;

void setup() {
pinMode(_CD4021B_latchPin, OUTPUT);
pinMode(_CD4021B_clockPin, OUTPUT);
pinMode(_CD4021B_dataPin, INPUT);
Serial.begin(9600);
Serial.write("Starting...\n");
}

void loop() {
int data1 = 0;
int data2 = 0;
int data3 = 0;
int data4 = 0;

digitalWrite(_CD4021B_latchPin, LOW);
data1 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data2 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data3 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data4 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
digitalWrite(_CD4021B_latchPin, HIGH);

if (data1 || data2 || data3 || data4) {
Serial.println(data1, BIN);
Serial.println(data2, BIN);
Serial.println(data3, BIN);
Serial.println(data4, BIN);
Serial.println("========");
delay (300);
}
}
</code>

>> No.1768290 [View]
File: 27 KB, 1825x626, screenie.png [View same] [iqdb] [saucenao] [google]
1768290

I have a board set up with 4 CB4021Bs reading from 31 switches. I have an issue where it looks like the pin readings are offset by 1 on each chip. Pic related, it's a shot of 2 (zooming out to show all 4 gave shitty pic quality.)

So, with the following code it means that the switch on PI-1 (pin 7) should be the most significant bit 0x80, but it is read in as the second most significant bit 0x40. It also means that the switch on PI-8 (pin1) is supposed to be the least significant bit, but is read as the most significant bit on the next IC in the chain.

My first thought was an issue with clock speed, but it behaves the same way with only one of the ICs attached to the board. Otherwise, I have no idea what the issue is. Any thoughts?

Also, this is the same board as from >>1763570

<code>
int _CD4021B_dataPin = 5;
int _CD4021B_clockPin = 6;
int _CD4021B_latchPin = 7;

void setup() {
pinMode(_CD4021B_latchPin, OUTPUT);
pinMode(_CD4021B_clockPin, OUTPUT);
pinMode(_CD4021B_dataPin, INPUT);
Serial.begin(9600);
Serial.write("Starting...\n");
}

void loop() {
int data1 = 0;
int data2 = 0;
int data3 = 0;
int data4 = 0;

digitalWrite(_CD4021B_latchPin, LOW);
data1 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data2 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data3 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
data4 = shiftIn(_CD4021B_dataPin, _CD4021B_clockPin, LSBFIRST);
digitalWrite(_CD4021B_latchPin, HIGH);

if (data1 || data2 || data3 || data4) {
Serial.println(data1, BIN);
Serial.println(data2, BIN);
Serial.println(data3, BIN);
Serial.println(data4, BIN);
Serial.println("========");
delay (300);
}
}
</code>

>> No.1765405 [View]

>>1765402
> I'd give it a pullup/pulldown resistor just to be safe.
I have to do another version of the board and get it refab'd anyway for other reasons, so I'll add it in.
> Any reason you chose the 4021 over the 74HC165 while we're here?
Lack of knowledge I guess? The arduino guides have the 4012 in the examples so I just went with them.

>> No.1765397 [View]

>>1765172
>>1765173
The switch is fine, swapped it out with another and no change. Assuming I measured it properly, voltage on the IC pins looks fine.

A few thoughts after some more troubleshooting:

Do all outputs of the CD4021 need to be hooked up? Currently pin7 on p104 is not connected to anything.

I've used 1k ohm on the pull down resistors, but the arduino guide for shiftin that details how to use the cd4021 has 10k ohm. Not sure if that might be an issue, as I said, all the other switches work fine, so seems unlikely.

>> No.1765113 [View]

>>1764881
Yeah, i tried that, swapped p103 and p104, same results, so it can't be the IC

>> No.1763571 [View]
File: 57 KB, 1269x824, 1580611540823.png [View same] [iqdb] [saucenao] [google]
1763571

>>1763570
Footprint. I've removed the copper pours for gnd and +5v from kicad for that screenshot for easier viewing, but they exist on the fabricated board. You can see the trace from SW102 to R194 to pin 1 on P104, a CD4012BE IC.

>> No.1763570 [View]
File: 28 KB, 1603x769, 1580611369417.png [View same] [iqdb] [saucenao] [google]
1763570

Electronics noob here, cross posting from /mcg/ hoping someone can help me out with an issue.

I've got a PCB I had fabricated based off a kicad schematic, excerpt pic related. There are 4 CD4021BE ICs, each with switches connected to the parallel input pins, forming a keyboad, as well as some additional switches.

SW102 doesn't register presses at the arduino for some reason, but every other switch on the board does, and I'm not sure what the issue is. On the board, multimeter tells me that switch operates fine and there's no shorts or bad solder connections.

Any ideas what I've done wrong? I'm at wits end, but also I expect the problem to be stupidly simple.

>> No.1761209 [View]
File: 57 KB, 1269x824, footprint.png [View same] [iqdb] [saucenao] [google]
1761209

>>1761207
Footprint. I've removed the copper pours for gnd and +5v from kicad for that screenshot for easier viewing, but they exist on the fabricated board. You can see the trace from SW102 to R194 to pin 1 on P104, a CD4012BE IC.

>> No.1761207 [View]
File: 28 KB, 1603x769, schematic.png [View same] [iqdb] [saucenao] [google]
1761207

Electronics noob here, hoping someone can help me out with an issue.

I've got a PCB I had fabricated based off a kicad schematic, excerpt pic related. There are 4 CD4021BE ICs, each with switches connected to the parallel input pins, forming a keyboad, as well as some additional switches.

SW102 doesn't register presses at the arduino for some reason, but every other switch on the board does, and I'm not sure what the issue is. On the board, multimeter tells me that switch operates fine and there's no shorts or bad solder connections.

Any ideas what I've done wrong? I'm at wits end, but also I expect the problem to be stupidly simple.

>> No.1726059 [View]

>>1726049
Thanks, I'll look into those. Also, sure, if you like:

https://we (.) tl/t-mED8BMqdYt

>> No.1725991 [View]
File: 570 KB, 1920x1055, Screenshot from 2019-12-01 16-05-00.png [View same] [iqdb] [saucenao] [google]
1725991

>>1725990
And 3d model from kicad. It's going to be a enigma machine powered by an arduino

>> No.1725990 [View]
File: 171 KB, 2591x3900, back.png [View same] [iqdb] [saucenao] [google]
1725990

>>1725989
reverse side.

>> No.1725989 [View]
File: 166 KB, 2591x3900, front.png [View same] [iqdb] [saucenao] [google]
1725989

Who do folks use for PCB fabrication? OSH park wants $200 USD for this.

Also, while I'm here, this is my first kicad pcb design. Thoughts?

>> No.1634417 [View]

>>1633196
>paying money to be tracked
No thanks

Navigation
View posts[+24][+48][+96]