555 based Latching Switch

The humble 555 timer IC has been around for a very long time. It can be configured to do a lot of timer based functions, the most common know being to flash LED’s at a given frequency.

A slightly more unknown function of this versatile chip is the capability to be configured as a latching switch, -meaning a press on press off switch-.

In this short two part series, I will show two such latching switch modules that I have designed around the 555 timer. In the first part, we will look as a single latching switch, with an attached relay output to switch higher current and voltage loads safely.

The PCB

Latching switch Prototype

With only 11 components ( excluding the relay and connectors or course) this is an extremely easy and cheap circuit to build. It can also quite easily be built on a breadboard, or strip board, if you do not want to use a custom PCB.

Schematic

Operation of the Circuit

The operation of this circuit is quite easy. The PCB is powered by a 5v supply, in this case, but the 555 can allow for a supply voltage of up to 15v DC ( Please note that the Relay needs to be capable of accepting the input voltage without damaging its coil… you would thus have to select a suitable model)

When you press and release the push button, pin 3 of the 555 will go high, lighting the indicator LED, as well as pulling the gate of the BSS138 Mosfet High, allowing current to flow through the relay coil, thus energising the contacts.

The relay will stay energised until you press and release the button again, or power is removed from the circuit.

Possible uses

This type of circuit has many uses, like switching a light on and off with a single press. It is obviously cheaper and easier to just use a toggle switch, but it is also interesting to explore the possibilities of a discrete component solution, without a microprocessor, to achieve a result similar to that of a toggle or rocker switch.

Manufacturing

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

More Pictures

I2C IO Card for ESP-12E I2C Base Card

The I2C IO Card for ESP-12E I2C Base Card is another expander card for the ESP-12E I2C Base Card Project. This PCB is an address-selectable I2C module with two relays and six (6) GPIO pins, all driven from a single PCF8574 running at 3v. The relays are optically isolated, and generous mains isolation cutouts were provided to reduce the possibility of mains voltage tracking. A jumper to enable/disable the i2c pullup-resistors is also provided on the PCB.

The relays are powered from a single LDO regulator, accepting 12v DC from the 2x20pin female header on the bottom of the card. 3.3v and ground should also be applied to the card at the 2x20pin header.

It is worth mentioning that this circuit does not contain level converting circuitry and that the i2c bus thus runs at 3.3v to be compatible with ESP chips.

It is possible to use the card with other processors if the appropriate level converters are used on the i2c bus.

The Schematic

Manufacturing the PCB


Over the past eight years, PCBWay has continuously upgraded their MANUFACTURING plants and equipment to meet higher quality requirements, and now THEY also provide OEM services to build your products from ideas to mass production and access to the market.


The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5 USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

ATMega 328P Based PWM controller Card

As part of my recent ESP-12E I2C Base Board project, I designed an ATMega 328P Based PWM controller card, that can be used as an add-on card with the existing project, or standalone as a custom Arduino Nano compatible development board.

What is on the PCB?

The PWM controller card contains standard Arduino Nano circuitry running at 16MHz, without the USB to Serial converter, as well as a 3v to 5v level converter on the I2C port ( A4 and A5 ), as well as another 12v to 5v level converter, with a build in resistor-divider circuit, used to drive a 12v blower with 3.3v PWM control circuitry.

All analog inputs are broken out to make attaching additional sensors easier.

All the other unused GPIO pins are also broken out, either directly to headers on the PCB (D6~,D7,D8,D9~), D11,D12,D12 (ISCP Header) and D3 ( Marked RPM on the Fan Header)

Most of these pins are also additionally broken out onto the 2x20p female header at the bottom of the card ( See schematic for more details)

The board is designed to be powered from 12v DC (via the VIN pins on the 2x20p header) which is internally regulated down to 5v via an LDO voltage regulator.


External 3.3v should also be supplied to the 2x20Pin header to enable the I2C level converters on the same header. I2C is not directly broken out onto the PCB in this version of the PCB.

A reset button, and power led, as well as the standard led on D13 is also provided.

Manufacturing the PCB


Over the past eight years, PCBWay has continuously upgraded their MANUFACTURING plants and equipment to meet higher quality requirements, and now THEY also provide OEM services to build your products from ideas to mass production and access to the market.


The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5 USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

ESP-12E I2C Base Card

As a follow-up on the ESP-12E Card, today we will look at the prototype base card that this was designed to slot into – The ESP-12E I2c Base Card.

Initial Features ( To be expanded in future versions )

4 x 40Pin Expansion slots, with access to 12v, 3.3v and Gnd on each slot.
2 x “IRQ” pins per slot ( serviced by a single PCF8574 )
I2C bus access on each slot (3.3v )
UART Header
Reset and Flash Header
GPIO Header ( Direct access to the ESP-12E GPIO Pins )
Analog Input Header (a Single input – A0, as per ESP-12E limitation)
Buck Converter Power Supply Module, capable of up to 2A of current

ESP-12E I2C Base Card – Top view

The Schematic

Schematic

The PCB – some pictures

ESP 12-E Card with Base Board

Manufacturing the PCB


Over the past eight years, PCBWay has continuously upgraded their MANUFACTURING plants and equipment to meet higher quality requirements, and now THEY also provide OEM services to build your products from ideas to mass production and access to the market.


The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5 USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

ESP-12E Card

A few months ago, I started working on an MCU Card design, which borrows from the idea of a standard desktop PC, in which there are a main-board, MCU and expansion slots, to add and remove peripherals as needed quickly.

The ESP-12E Card is a continuation of that project, with the ultimate goal to have a universal “main-board” that can accept various MCUs and standardised “expansion modules” that perform a specific task.

ESP-12E Card
ESP-12E Card

The PCB

The ESP-12E Card contains the bare minimum components to allow the chip to function. There are no power regulators or USB-to-TTL converters onboard. Code is flashed via an external USB-to-TTL converter, with Flash and Reset buttons on the actual PCB, or available in the 2×20 Pin female header at the bottom of the card.

Most of the GPIO is also broken out to the 2×20 pin header, with the exception of the 6 GPIO that is usually connected to the internal Flash on the ESP-12E module.

I have made provision for enough power and ground pins on the header as well.

As far as GPIO is concerned, They have been grouped together by function, as much as possible at least, to make interfacing with the base-board as easy as possible.

The Schematic

ESP-12E Card Schematic

The schematic is not complicated. It is a standard ESP-8266 configuration, with all non-essential components removed.

The “base-board” ( a sneak preview )

Sneak preview of the Base Card

In a future article, I will tell you more about this ( for the time being limited to I2C ) base card. [ a quick explanation: When I mean limited to I2C, it relates to the fact that at the moment, the base card, ( a prototype ) can only communicate back to the MCU via I2C protocol from each of the expansion slots, as well as via two dedicated IRQ lines from each slot ]Power is supplied via a small SMPS module.

Manufacturing the PCB


Over the past eight years, PCBWay has continuously upgraded their MANUFACTURING plants and equipment to meet higher quality requirements, and now THEY also provide OEM services to build your products from ideas to mass production and access to the market.


The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5 USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

Robotic Toy Car – Part 5

In this almost post we look at the power distribution PCB for the almost completed Robotic Toy Car. I had many interesting issues to solve here, especially since I did not design my own Lipo battery charger circuit, but used a very useful little commercially available unit instead, the MH-CD42

Based on a relatively difficult chip to get information on, the module is basically an integrated Lipo charge/discharge module, with a built-in boost converter that provides 5v at a maximum of 2A current. What makes it special is the ability to simultaneously provide current and voltage, as well as charge the attached LiPo cell at the same time, when connected to an external charger.

It does, however, in my view at least, also have a few serious flaws, the most irritating of these being that it will completely discharge the attached LiPo cell even when completely switched off…

I have thus tried to stop this issue from occurring by adding a switch in line with the Lipo Cell, a quite obvious solution, but it should not have been needed if the chip functioned as intended… ( As far as I can gather, the module was originally designed to be used in USB power banks. This makes the flaw even more serious, as a self-discharging power bank really defeats the purpose)

Enough of that though, when it does work, it works great. just remember that you can not apply more than 5.5v DC to the charging input of the module.

The completed Power Distribution and charging module

The Schematic

There is actually not a lot going on here, as everything is already on the supplied module. I have just added a charging port, additional power headers for 5v output and ground, as well as direct access to the LiPo Cell output, and a switch header to cut off power to the MH-CD42 when it is not in use.

The PCB

The PCB was manufactured as a 2-layer FR-4 board. The entire top layer is used as a ground plane, and the bottom layer was used for the 5v and Vbat traces, which were made as big as possible to allow for the high current ( up to 2A ) that the unit can supply to a load.

The TOP later of the PCB is a complete ground plane.
The BOTTOM Layer caries only power traces for 5v and VBat
a 3D Render of the PCB, showing header pins and other connections

It is also worth mentioning that the VBAT pins are NOT 3.3v ( Remember that the LiPo cell can run from 4.2v down to 3.0v depending on the charge. These headers were only placed on the board to provide direct access to the LiPo cell, for use with for example an ADC input or for connection to a dev board that is already fitted with a buck converter or a suitable LDO voltage regulator.

The Actual PCB, as received from PCBWay
Top Layer of the PCB
Bottom Layer of PCB

Manufacturing the PCB


Over the past eight years, PCBWay has continuously upgraded their MANUFACTURING plants and equipment to meet higher quality requirements, and now THEY also provide OEM services to build your products from ideas to mass production and access to the market.

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

A breadboard friendly MCP23017

I2C port extenders or expanders are extremely useful devices, and I use quite a lot of them in my projects. My go-to device is definitely the PCF8574, mainly because it is sort of “breadboard friendly”. The MCP23017, with the existing breakouts available locally, are not. I have thus decided to design my own version of a breadboard friendly MCP23017 breakout board.

The Breakout Module PCB and its features

A breadboard friendly MCP23017 breakout board – Front
a breadboard friendly MCP23017 breakout board – Back

While this was definitely one of my easier projects, It still took a bit of time to get it just right and add some essential components and features directly onto the PCB.

The main features of this breakout:
– DIP12 Layout – with all pins broken out, address pins to jumper headers…
– Proper decoupling capacitors, as close as possible to the MCP23017 chip.
I had to make use of the back layer of the PCB to do this, not exactly ideal, but with proper power and ground planes, and nice thick tracks, I believe they will be just fine.

– Address selector jumpers – The breakouts that are available locally, do not have these.
– Breadboard friendly layout – 33.020mm x 20.320mm [board size], with 15.240mm vertical spacing between the rows of pins, ensures that you can easily fit it onto your breadboard, while still having space to add jumper wires to the pins. Horizontal pin spacing is standard 2.45mm.

The Schematic

The schematic is plain and simple. A few points to note though:
– The address selection header, as well as the io pin headers are not shown on the schematic.
– I2C pullup resistors are set at 1k but can be replaced with more suitable values as required in your circuit

Using the breakout

I have previously written two very detailed articles on using this chip. They are linked below:
Using the MCP23017 with the standard Wire.h library
Using the MCP23017 with the Adafruit MCP23017 library

Manufacturing the PCB

The PCB for this project is currently on its way from China, after having been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to be manufactured.

PCBWay

If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

ESP32-S Card Module

ESP32-S Card Module

What is this?

This project is the result of a lot of prototyping, using different MCUs and wanting to find a way to get a standard interface to all the devices.

The idea is to eventually create similar card-type MCU breakout boards, with similar pins in the same position on the 2x20p breakout header,

for example, power, i2c bus, reset and flash will always be in the same position on the female header…

Step 2 from here on would be to design a baseboard, that is capable of providing power, as well as access to the various GPIO pins. I am thinking along the way of a PC motherboard style interface, with “slots” at regular intervals. These “slots” will have access to the SPI, and I2C bus, as well as various other GPIO.

Step 3 would be a series of commonly used input and output “cards” that will plug into the “slots”…

If successful, I plan to design various MCU cards, with various different processors, with the obvious criteria that they are 3v powered.

This could result in a very flexible development platform, where it is possible to reuse the base-board and IO “cards” with any one of the various MCU “cards”.

The Schematic

As seen on the schematic, almost all of the ESP32-S’s pins are broken out, with the exception of those used for internal flash. Reset and Flash circuitry is provided on the PCB, as well as on the 2x20pin female header.

It is worth noting that I did not include any UART to USB circuitry on the card. Flashing should be performed with an external USB-to-UART converter. It will however be included in the base-board.

There is also no power supply circuitry onboard. This was also intentional, as the card is intended to be powered from the base-board. It is however perfectly acceptable to power only the card from a suitable 3.3v DC power supply unit through the 3v and gnd pins on the 2x20pin header.

Where can I get my own version of this module?

This module will be exclusively available from PCBWay for the foreseeable future. Click on this link to order your own, and help support a great company that produces very high-quality PCBs for a very affordable price.

PCBWay

This PCB was manufactured at PCBWAY. The Gerber files and BOM, as well as all the schematics, will soon be available as a shared project on their website. If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

Level Converted CAN-BUS Module

Introduction
Schematic
How does it work? / How do I use it?
Arduino Example
ESP32 Example
Where can I get my own version?

Introduction

There are many CAN-Bus modules available for purchase to the DIY Electronics Enthusiast and the Maker community. Our Level Converted CAN-BUS module is different. Where the standard modules are all 5v devices, ours are level converted, allowing you to interface it with 3v and 5v microcontrollers, the choice is yours…

Level Converted CAN-BUS Module
Level converted CAN-Bus Module
Level converted CAN-BUS Module next to a standard commercial module designed for the Arduino ecosystem or similar
Level Converted CAN-BUS Module together with standard CAN-BUS breakout for comparison.

The Schematic

Schematic for the  Level converted CAN-BUS Module

How does it work? / How do I use it?

The Level Converted CAN-BUS Module is based on the MCP2515 CAN Controller from Microchip, with the TJA1050 CAN Tranceiver used for communicating with the CAN-Bus. These two chips are extremely cheap and easy to get hold of, but they are also one of the main reasons for the redesign of the module.

While the MCP2515 is useable with a voltage range of 2.5v to 5v, the TJA1050 is not. When using the commercially available CAN-Bus modules, this limits you to using 5v microcontrollers, or for the more informed, using level converters in-between to translate back and forth to the desired logic levels.

The MCP2515 is an SPI device, and in my opinion, having long wires on an SPI bus is not always the best way of doing things, due to ringing and other undesirable interference. Having to add a level converter module into this already questionable setup, can add a lot of other undesirable effects.

I have thus decided to design and manufacture my own module, with 5 level converters directly on the PCB, thus reducing the length of connecting wires, as well as reducing complexity.

Using the device is now as easy as providing a 5v voltage source, as well as an additional 3v source if you need the level converters, and connecting your microcontroller to the appropriately marked logic side of the module.

A jumper at H1 can be set/unset to enable the 120ohm ballast resistor that is needed on the CAN-Bus for very short distance connections.

Example connection to an Arduino

Use the 5v logic side, and power the module with 5v and ground. You do not need a 3v power source.
Connect the pins as follows:

CS pin to Arduino Pin 10
SO to the MISO pin on the Arduino Pin 12
SI to the MOSI pin on the Arduino, Pin 11
SCK to the SCK pin on the Arduino, Pin 13
INT to an interrupt capable pin on the Arduino, usually pin 2 or 3

Example connection to an ESP32 module

Provide a 5v as well as 3v power source with a common ground connection.
Connect your logic to the 3v logic side of the PCB Module.


CS pin to GPIO2
SO to the MISO pin, GPIO19
SI to the MOSI pin, GPIO23
SCK to the SCK pin, GPIO18
INT to an interrupt capable pin on the ESP32

Where can I get my own version of this module?

This module will be exclusively available from PCBWay for the foreseeable future. Click on this link to order your own, and help support a great company that produces very high-quality PCBs for a very affordable price.

PCBWay

This PCB was manufactured at PCBWAY. The Gerber files and BOM, as well as all the schematics, will soon be available as a shared project on their website. If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.

Battery Backup for your Pi Zero (W)

Battery Backup for your Pi Zero (W) is a very important feature to prolong the life of the SD Card. Many commercially available solutions exist, in the form of Hats, but, unfortunately, it seems that anything that was specifically designed for the Raspberry Pi, can be quite expensive.

The 40 pin header on our Raspberry Pi Zero / Zero W gives us a lot of potentials to expand the functionality of this tiny single-board computer, but it, unfortunately, suffers from two major flaws, from my point of view of course.

  • The pins are scattered all over the place, and not grouped by function.
    Access to the pins is also very cluttered, to keep the overall footprint of the board small.
  • The GPIO pins are 3v only; adding anything that runs on a different voltage becomes a messy
    assembly of wires and level converters and or resistor dividers… going to a breadboard…
Raspberry Pi Zero / Zero W

My Solution

Solving these issues required a lot of deep thinking, it actually took me a few months, during which I looked at various commercial solutions, imagined things in my mind, as well as tested concepts and various modules.

Let us take a look at some of these before I show you the solution that I am currently working on.

Battery Power

I would like to use a single 18650 LiPo cell to power the Pi Zero. Other Battery Backup solutions make use of this as well. In the ideal world, a pair of these in parallel would be great. The 18650 cell is a 3.3 volt ( nominal 4.2v) LiPo cell. The Pi needs 5v to run. This would require a Boost converter, as well as a dedicated LiPo charging circuit to recharge the cell after use.

Many such charging and Boost converters are available, but they seem to suffer from a problem, they need a dedicated charging cycle, during which using the device is not advised.

I could design my own circuit, but as I do not consider myself a proficient power supply designer, and with the huge amount of professionally designed, low-cost modules available, I decided to use the MH CD-42 module instead.

MH-CD42

This module seems to give me all the features I need, with only one exception: The input voltage MUST be between 5.0v and 5.5v. I hope to address that issue later though.

It can source up to 2A at 5v, and most importantly, has a current bypass function, which allows you to charge the battery, as well as power an external device at the same time.

GPIO Pin Grouping and Level Conversion

The next logical step was to design a base-board that contained the 18650 Cell, and power module, as well as provide access to the GPIO pins.

Pi Zero Base Board

I decided to use a 90 degree 2×20 pin Female header to mount the Pi, allowing for plenty of airflow around it to prevent overheating, as well as clearly labelled header pins for access to the GPIO pins.
( Due to logistics issues, the female header pin has not arrived yet).

The logic level conversion was provided on some of the GPIO ( SPI0, SPI1, I2C and UART ) by using the TXS0108E 8Ch Bidirectional Level Shifter chip from TI. Headers in black are 3v ( with exception of GPIO13) and 5v logic pins are on a white header.

Additional Ground and Power headers for 5v and 3v (red headers) were also added.
Finally, a dedicated shutdown button was connected to GPIO26.

Schematic

Testing the prototype

The prototype is still under testing, as mentioned above, I still have to receive the 40 pin female header.
I did however connect the Pi Zero to the board with jumper wires ( 3v, 5v and ground only ) to test operation. So far, the setup provides 5 hours of battery backup with the Pi on idle, no external devices connected and running only an MQTT server on Raspberry Pi Lite OS ( No Gui )

The first revision of the device is available for order at PCBWay

Manufacturing the PCB

PCBWay

This PCB was manufactured at PCBWAY. The Gerber files and BOM, as well as all the schematics, will soon be available as a shared project on their website. If you would like to have PCBWAY manufacture one of your own, designs, or even this particular PCB, you need to do the following…
1) Click on this link
2) Create an account if you have not already got one of your own.
If you use the link above, you will also instantly receive a $5USD coupon, which you can use on your first or any other order later. (Disclaimer: I will earn a small referral fee from PCBWay. This referral fee will not affect the cost of your order, nor will you pay any part thereof.)
3) Once you have gone to their website, and created an account, or login with your existing account,

4) Click on PCB Instant Quote

5) If you do not have any very special requirements for your PCB, click on Quick-order PCB

6) Click on Add Gerber File, and select your Gerber file(s) from your computer. Most of your PCB details will now be automatically selected, leaving you to only select the solder mask and silk-screen colour, as well as to remove the order number or not. You can of course fine-tune everything exactly as you want as well.

7) You can also select whether you want an SMD stencil, or have the board assembled after manufacturing. Please note that the assembly service, as well as the cost of your components, ARE NOT included in the initial quoted price. ( The quote will update depending on what options you select ).

8) When you are happy with the options that you have selected, you can click on the Save to Cart Button. From here on, you can go to the top of the screen, click on Cart, make any payment(s) or use any coupons that you have in your account.

Then just sit back and wait for your new PCB to be delivered to your door via the shipping company that you have selected during checkout.