Why limit yourself to only two Serial ports? (said no-one ever)
My Rambo main controller board has 2 active serial ports. Serial 0 is the USB connection from my laptop, and serial 1 is the secondary port that you can enable in Configuration_adv.h. My Joystick controller requires a serial connection to service the 'Reset origin' button on the top of the joystick. However, I also have my wireless tablet attached to my Rambo board. I could either risk just connecting them all, and not transmitting serial data at the same time, or I believe they can all join together through diodes. |
But, after some scratching around in the workshop, I dug out some (very old) 4000 series IC's. My first design used a 4066 4 gang switch and a 4001 series quad Nor gate. It worked, but it soon became apparent that is was less than an elegant design, and you still in theory, connect more than one serial data source at the same time (so therefore, not completing it's task). |
So, after making the initial stripboard, I swapped the 4066 for a 4051. This is an eight way multiplexer IC, and I had a few of them lying around. This is a better switch IC, as it's break before make and you cannot mix the channels.
It uses an address on the A,B and C pins to connect one of it's eight output pins to the input pin. I only needed three connections, but I made the board with a possible four serial switches for future use.
The 4000 Nor gate became surplus, so I just used it to show a 'Default' LED indicator.
It uses an address on the A,B and C pins to connect one of it's eight output pins to the input pin. I only needed three connections, but I made the board with a possible four serial switches for future use.
The 4000 Nor gate became surplus, so I just used it to show a 'Default' LED indicator.
So, I used this output to automatically switch the serial across to the Bluetooth when a phone is connected.
You can also select one of the other three serial sources by either applying 5v to one of the screw terminals, or operating the DIP switches 1-3.
Dip switch 4 changes the HC-05 modules Enable/Key input between Data mode and AT mode.
I ran this little unit off it's own 7805 5v regulator, as the Bluetooth module does suck a lot of juice. Also, it has a hefty capacitor across it, as they are pretty noisy.
Add a 3d printed enclosure and job done.
You can also select one of the other three serial sources by either applying 5v to one of the screw terminals, or operating the DIP switches 1-3.
Dip switch 4 changes the HC-05 modules Enable/Key input between Data mode and AT mode.
I ran this little unit off it's own 7805 5v regulator, as the Bluetooth module does suck a lot of juice. Also, it has a hefty capacitor across it, as they are pretty noisy.
Add a 3d printed enclosure and job done.