Close

38 pins vs 30 pins

A project log for Ventbot: warm side cool, cool side warm

A DIY register booster project to even out the temps around my home.

wjcarpenterWJCarpenter 02/20/2023 at 01:100 Comments

I did the whole design based on using the 38 pin ESP DevKitC, though there are a lot of unused pins. I started wondering if someone could use the PCB with a 30 pin ESP DevKitC, with only software changes. The answer is "almost". The pin assignments in the software and in the physical PCB layout are in this project log entry: ESP32 pin assignments

My assumption is that any of the software-controlled inputs and outputs could be switch to another pin, modulo things like "input only" pins. I can't change things that aren't controlled by software: Vin 5v, 3.3v output, and ground pins. Many, but not all, of the signal pins line up nicely in the two footprints if you slide the 30 pin device down one notch. That is, pin 1 of the 30 pin device is placed in position pin 2 of the PCB footprint.

The 38 pin layout looks like this:

1  3.3v         38 gnd
----------------------------
2  reset*       37 f4-pwr*
3               36 i2c-scl*
4               35
5               34
6               33 i2c-sda*
7               32
8               31 f4-tach**
9   f1-tach*    30 f4-pwm**
10  f2-tach*    29
11  f3-tach*    28 f2-pwm**
12  f1-pwr*     27 f1-pwm**
13  f3-pwr*     26
14  gnd*        25
15  f2-pwr      24
16              23 f3-pwm
---------------------------
17              22
18              21
19  Vin 5v      20 

In that list, signals marked with a single asterisk means that they show up in the same GPIO on the (adjusted)  position on the 30 pin device. (It can be a little confusing because not all of the GPIOs how up in the same relative positions. It's the GPIOs that are of interest.) Signals marked with 2 asterisks mean the corresponding pin isn't the same, but the signal can still be accommodated with a software re-arrangement. Signals with no asterisk means that something extra has to be done.

Here's the corresponding (adjusted) 30 pin layout:

1  reset        30 f4-pwr
2               29 i2c-scl
3               28
4               27
5               26 i2c-sda
6               25
7               24 change from f4-pwm to f4-tach
8  f1-tach      23 same as 29 (GPIO 5), as f4-pwm
9  f2-tach      22
10 f3-tach      21 change from f1-pwm to f2-pwm
11 f1-pwr       20 same as 26 (GPIO 4), as f1-pwm
12 f3-pwr       19
13 gnd          18
14 gnd          17
15 Vin 5v       16 3.3v

Here are the modifications needed to make this work:

The special handling for f2-pwr and f3-pwm is required because the corresponding pin on the 30 pin device is ground or  3.3v output. There's no way around it other than severing those signals and running a new f2-pwr and f3-pwm signals. 

Luckily, there is an unrelated PCB option that can come to the rescue for f3-pwm. The signals for f2-pwm, f3-pwm, f4-pwm, f2-pwr, f3-pwr, and f4-pwr are routed to 3-pin jumper options. On the v4 board, there is a trace connecting pin 1 and pin 2 of each of those jumper options since that's the behavior that is usually wanted. That trace is on the top side of the board, not clearly visible under the solder mask and silk screen. 

Unfortunately, the same jumper option trick can't be used for re-routing f2-pwr. The f2-pwr signal is a digital signal controlling a MOSFET transistor, and it's the output of that MOSFET that goes through the jumper option. There is an only semi-ugly hack that we can use. The digital signal controlling the MOSFET for f2-pwr passes through resistor R42. Instead of soldering both ends of that resistor to the PCB, solder only the lead nearer the MOSFET. The other lead, which would normally be soldered to a pad nearer the ESP32, can be left unsoldered as an attachment point for a jumper wire.

The complete fix would be:

I haven't tested this, but it should all work out unless I have made a mistake. Aside from software changes, which should be a trivial ESPHome config file edit, it's just 1 cut trace, one lifted resistor lead, and two "white wire" jumpers, which is not too bad. If I had been thinking about this from the beginning, I could have made the special handling of f2-pwr and f3-pwm unnecessary. Oh, well.

Discussions