1
\$\begingroup\$

I have a design for an electronics workbench that has 2 Arduino's (a Mega and an Uno), and several component testers that have Atmega328 MCU's at their core, and I was wondering if there is a way to have one BT HC-05 module that I can switch between the devices to program them individually one at a time (rather than having 4 BT modules ie. one for each).

They can share a common 3.3V rail, ground, and LED indicator pins as all the devices share the same power and ground. AFAICT the only 3 bus lines that need to be switched between the devices are the RST (using the HC-05 pin 32 & 100nF Capacitor), TX & RX lines. What components & circuit can I use to select and switch these three bus lines to the devices I wish to program?

The basic circuit for one device with one BT module is here: -> Arduino BT programming circuit

Though I will be using the bare module, not the version on a 5V adapter board.

Could I use 3 quad optocouplers (one each for the 3 lines that need to be swiched between the 4 devices) and some mechanism to select when to turn the one I want in each OC package on? I understand how to turn on the OC (probably with the ATMEGA328 or a latching logic gate triggered by a push button, but would I need any components around the OC on the data line side (the EC side of the OC) or would it be pretty much a simple placement of the quad OC transistor side into the circuit? I'm stretching my knowledge here a bit, but you have to learn somehow I guess.

\$\endgroup\$
  • \$\begingroup\$ Could I use 3 quad optocouplers (one each for the 3 lines that need to be swiched between the 4 devices) and some mechanism to select when to turn the one I want in each OC package on? I understand how to turn on the OC (probably with the ATMEGA328 or a latching logic gate triggered by a push button, but would I need any components around the OC on the data line side (the EC side of the OC) or would it be pretty much a simple placement of the quad OC transistor side into the circuit? I'm stretching my knowledge here a bit, but you have to learn somehow I guess. \$\endgroup\$ – Braedon King Jul 11 '16 at 12:38
  • \$\begingroup\$ Why are you commenting on your own post? Put all the information required to answer your question into the question. \$\endgroup\$ – Transistor Aug 9 '16 at 6:13
  • \$\begingroup\$ @Braedon King I am a little bit confused! Do you want to program 4 arduino boards using one HC-05 module? \$\endgroup\$ – Macit Jun 11 '17 at 23:18
1
\$\begingroup\$

Another possible approach is using yet another micro as a router of sorts. Have all of the subsystems talk to it over UART, SPI, whathaveyou, and let this router handle the BT communications.

This way sure does have some benefits - you can keep the connection to the BT module at all times, which may even result in Better UX™; you can make it present a simpler/better-suited protocol to the other subsystems, without those needing to care about which particular BT module you happen to use, if any! Abstraction!

You seem to have no shortage of microcontrollers in the project already, so tossing another one in shouldn't be that much of a problem, eh? :D

\$\endgroup\$
  • \$\begingroup\$ (Bump because it was on the homepage for some reason, and I felt like answering) \$\endgroup\$ – Richard the Spacecat Mar 11 '18 at 2:21
  • \$\begingroup\$ Depending on what exactly you're trying to acheive, and what GPIOs you're using you could do a similar thing; designate one of your current MCUs as "MASTER" which has bluetooth access, and be able to let that pipe UART through t any other device... \$\endgroup\$ – DThought May 16 '18 at 13:35
0
\$\begingroup\$

One thing first, you do not want to connect PIN32 in your configuration.

PIN32 is intended to signal when the HC05 is paired (see page 4). If I'm judging the intent of that circuit correctly, when the HC05 transitions from paired to unpaired, RST (which is active low) will be pulled low by PIN32 momentarily, causing the Arduino to reset, which I am guessing is not what you want.

For switching between devices, is it important that you can do it remotely? If not, UART is very simple and the default data rate of the HC05 is low. A double pole triple throw switch would suffice. Just make sure you have pull up/down resistors on any lines that would be left floating when its not connected or in the process of switching.

\$\endgroup\$
0
\$\begingroup\$

You can use a bilateral switch like CD4066. Here's a simple tutorial on how to use it. This semiconductor switch is bi-directional, so while I'm going to use terms "input" and "output" they can be swapped around. So, place one switch at each of your programming targets lines (RX, TX, RST), connecting switch output to the target. Then connect all RX switch inputs together and to the Bluetooth module. Repeat for TX and RST switches. Connect all control inputs for each programming target together, and add a pull down resistor at each target switch group's control inputs. Then use a good old mechanical switch to select one target control input and connect it to +5V. This will allow you to use a simple single pole mechanical switch (slide or rotary) to control three lines of signals.
Alternatively, you can get a three-pole switch and use it without any semiconductors, but three-pole switches tend to be bulky and expensive.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.