Dual 555 Latching Switch Module

In a recent post, I looked at a single-channel version of this module. While it may be a repetitive post, I will continue, as it shows how easy it is to double up on this circuit to provide more than one latching switch on a single circuit board. The current drawn by this module is so little, even when energised, that it compares favourably with even a microprocessor-controlled solution.

The real advantage will obviously be the cost, as the hand full of discrete components needed for this is way cheaper than a microprocessor alone, and the fact that it doesn’t need any coding makes for an attractive solution.

It is however worth noting that the circuit is quite sensitive to external interference, sometimes resulting in unwanted operation. This does not concern me too much, as 1) This is still a prototype and 2) While it does work as intended, and surely is quite useful, I do not intend using it to switch any high current load, or control any expensive or important equipment.

Since the previous post looked at the base circuit in detail already, I think it will be a good idea to talk a bit about electrical isolation, tracking and keeping the AC and DC sides of a circuit separated completely

In the picture above, we can clearly see that the DC side (near my hand, at the top is contained completely on the right side (top in this case) of the PCB. The hashed copper pour also stops clear of the two relays. There are only four tracks
going to the relay coils, and they are all on the same layer of the PCB.

Also note the square cut-out slot around the common terminal of each of the relays. This provides additional isolation to the relay, as well as the DC side of the circuit, as air is a very good insulator ( at least for 220v at no more than 10A — or so I was taught …) These cutouts will prevent any mains voltage of tracking, think burning towards, towards any other tracks in this area.

The entire left-side top layer ( underneath the relays) are also completely free of copper, to make tracking even more difficult.

If we now look at the bottom layer of this same PCB, we will see that the DC side and its ground-plane are once again completely separated from the relay contact terminals. Also note that the tracks connecting the screw-type connector and the relay terminals are very thick (100mil), straight and as short as possible. All copper around these tracks has also been etched away, further reducing the chances of tracking.

In a production PCB, Warning labels would also be present in the bottom silkscreen of the PCB in this area, warning the user of the possibility of mains voltage in this area. As this is a prototype, and to make the above-mentioned points easier to see, I have not added these labelling on these boards.

Important Disclaimer:
Electricity is NEVER “SAFE”. There are only safe practices and procedures. It is always the responsibility of the user to ensure their own safety. While the design shown above is considered “SAFE” by myself, I only consider it “SAFE” because I am aware of the risks involved in using such a circuit to switch mains voltage, at a certain current, and under a specific use scenario. DO NOT BE FOOLED into simply replicating this circuit, or parts of it, and believing it is “SAFE”. Every use case of a circuit is different, and the devices connected and controlled by it will always differ. Make sure that you ACTUALLY know what you are doing BEFORE using any High voltage/Current and switching it with any electronic device.

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

Some More Pictures

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

AI-WB2 and XIAO RP2040 Combo

`Ai-Thinker (#notsponsored) should be quite well known to many makers as a company that manufactured and designs many of the modules that we use in our projects. We, MakerIoT2020, definitely make use of quite a few of their products, like the RA-02, as well as their ESP32-S module.



A few months ago, I got the opportunity to play with one of their newest projects, the AI-WB2, which is based on the BL602 Risc-V Chip. After a very very bumpy ride, mainly due to the chip being quite new, and documentation being virtually nonexistent in the English language, I decided to take a step back, and stop trying to reinvent the wheel 🙂 Afterall, I don’t want to use Apache NuttX or a similar RTOS for every project, as the thought of having to write almost all of the different required components from scratch, does not really appeal to me. especially as the SDK is in Chinese, and the English version of it is a bit patchy, to say the least…

This made me quite a bit frustrated, at least until I decided to change my thinking, and take a look at the stock AT command set that comes shipped on the modules from the factory… While excellent for use as a WiFi modem, it did not seem to allow any access to any of the GPIO on the WB-AI2 module… But wait… is that really a problem? No… Let me tell you why…

I also have a few XIAO Modules ( the RP2040 and SAMD21 ) lying around, and those do not have any connectivity options onboard…

A few very quick tests later, It was clear that the AI-WB2 will be a very compact
WiFi as well as BTLE connectivity solution for these XIAO modules, and, If I design with the future in mind, the GPIO pins of the AI-WB2 module can also become useable to me as well… once the firmware and SDK gets more accessible..

What followed from this is a very basic prototype PCB, with the XIAO RP2040 as the main processor, and the AI-WB2-12F as a “connectivity co-processor”, meaning that all communications functions will be offloaded to the AI-WB2 and the results of those, sent back to the XIAO for processing…

This in itself presents quite a few challenges, especially on the communications handling, and using the second UART port, which is currently not possible with the official Arduino Core for the RP2040… Luckily, the XIAO RP2040 uses an alternative core, that supports the second UART port quite well …

What is on the PCB?

AI-WB2-12F XIAO Combo

The Top Section of the PCB is dedicated to the AI-WB2-12F and its supporting components, including a flash and reset button. The GPIO for the WB2-12F is broken out onto H1.

At the right, below H1, is a series of jumpers, connecting the Xiao RP2040 and WB2-12-F Uart ports, or, alternatively, connecting the XIAO Rp2040 to the pin headers at the side of the PCB.

The rest of the PCB is dedicated to the Xiao RP2040 or Xiao SAMD21 module, with its supporting circuitry, and a dedicated Reset button for the SAMD21 module ( also works for the RP2040)

The board is powered with 5v DC through a dedicated header at the left bottom. This directly powers the Xiao and indirectly powers the WB2-12-F through a 3.3v LDO Regulator. Please note that although the Xiao is powered via 5v, the GPIO pins are all 3.3v logic!

The Schematic and PCB

Schematic

PCB Layout

Software

MQTT Connection on the AI-WB2-12F

AI-Thinker Example

The full AT command set example is available here

For the Xiao RP2040, like I used, it is possible to use the second UART to connect to the AI-WB2 chip.

As I am still not completely done with my development, I will not release the full code at this moment.

I have also been informed by AI-Thinker that a new version of the AT-command firmware is available that will allow using the GPIO on the AI-WB2 via AT Commands. I am currently investigating that new version, and that is also a big reason for not releasing any code at this stage.

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

Carrier board for SEEEDuino XIAO

These days, Makers have access to quite a few different microprocessors for use in their projects. Most of them can be found on development boards of some sort, but not all are in a convenient size. The reason for this is that most of these development boards were designed with a breadboard in mind, and then after your prototype is done, you are required to design a PCB and place the specific processor and its supporting components onto this custom PCB…

Many makers choose to skip this step, either choosing to keep the project on the breadboard, or place the entire development module onto a piece of stripboard or similar, and then place their supporting components and sensors around that.

This is where the SEEED XIAO is different. It comes in a thumb-nail-sized package and can be used on the breadboard or directly placed onto a PCB via either pin headers or if you want access to all of its features, SMD pads.

SEEED XIAO SAMD21

In this build, I decided to design a generic carrier board, that will accept most of the XIAO RP2040 or the XIAO SAMD21

I have also included a small prototype area on the PCB, so that Makers can easily transfer their existing XIAO projects onto a semi-custom PCB, without having to design their own.

I have also addressed a problem area, especially with the XIAO SAMD21, it has no onboard reset button, only two tiny pads, by including a reset button for ease of use.

The PCB is in Arduino Uno form factor, and also provides headers to power it from an external 5v DC supply. Please note that the prototyping area has a 3.3v power rail, – due to the fact that all of the XIAO GPIO are limited to 3.3v anyway -. This power rail is powered directly from the XIAO 3.3v output, and the current is limited as per the specifications of the XIAO module that you are using.

Hardware Specifications – SEEEDuino XIAO

Hardware specifications and comparison

ProcessorESP32-C3 32-bit RISC-V @160MHzSAMD21 M0+@48MHzRP2040 Dual-core M0+@133MhznRF52840 M4F@64MHznRF52840 M4F@64MHz
Wireless ConnectivityWiFi and Bluetooth 5 (LE)N/AN/ABluetooth 5.0/BLE/NFCBluetooth 5.0/BLE/NFC
Memory400KB SRAM, 4MB onboard Flash32KB SRAM 256KB FLASH264KB SRAM 2MB onboard Flash256KB RAM, 1MB Flash 2MB onboard Flash256KB RAM,1MB Flash 2MB onboard Flash
Built-in SensorsN/AN/AN/AN/A6 DOF IMU (LSM6DS3TR-C), PDM Microphone
InterfacesI2C/UART/SPI/I2SI2C/UART/SPII2C/UART/SPII2C/UART/SPII2C/UART/SPI
PWM/Analog Pins11/411/1111/411/611/6
Onboard ButtonsReset/ Boot ButtonN/AReset/ Boot ButtonReset ButtonReset Button
Onboard LEDsCharge LEDN/AFull-color RGB/ 3-in-one LED3-in-one LED/ Charge LED3-in-one LED/ Charge LED
Battery Charge ChipBuilt-inN/AN/ABQ25101BQ25101
Programming LanguagesArduinoArduino/ CircuitPythonArduino/ MicroPython/ CircuitPythonArduino/ MicroPython/ CircuitPythonArduino/ MicroPython/ CircuitPython

The PCB

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