2

Right now I am onto a new project where I am building an obstacle avoiding landrobot.

I use an arduino pro mini as my board and I have a few hc-sr04 sensors here at home. The problem I have right now is that many pins is occupied with other modules, motors and bluetooth.

So right now on my Pro Mini the VCC is occupied by my BLE device and I was wondering if there is a possibility to solder a few wires together so that my BLE device share the same VCC with 4 other hc-sr04 modules? I do this regularly with the GND where I solder multiple wires together and share the GND across different modules which works fine.

I have soldered a wire looking like this: enter image description here

The idea is to power the arduino itself through the "RAW" pin. I have a power distribution board that connects to my battery/motor and the VIN pin of the PDB goes to the "RAW".

I try to avoid a breadboard to decrease the size as much as possible so if it were to be possible then that would be the optimal solution for this project.

Something I am also wondering is if it is possible to use these hc-sr04 on both the analog pins and also the digital pins. I do not have enough space to fit all the sensor cables on the digital pins but if I use the analog pins also then they all would fit. Is this possible? Each HC-sr04 has two cables that needs to be inserted (Trig and echo) and right now I have 3, 4 free and all the analog pins 0, 1, 2, 3, 4, 5 which is enough to fit them all.

enter image description here

  • You can indeed use analog pins as digital pins. – Gerben Apr 1 '17 at 13:26
  • if your Vin=Vcc, then you can go up the supply's limit, if not, then limit it to the capabilities of your voltage regulator. – dandavis Apr 1 '17 at 13:35
  • I use the "VCC" pin on the arduino pro mini to power the BLE and that is the pin i was thinking about sharing. I do not have a VIN on my arduino pro mini i think – Martman Apr 1 '17 at 13:37
  • This is how I will setup the entire project: I use a power distribution board that connects to my 4s lipo battery/motor. The GND of the power distribution goes to the GND and the VIN goes to the "RAW" of the arduino pro mini. – Martman Apr 1 '17 at 13:40
  • RAW is connected to the input to the regulator, whereas VCC is connected to its output. As a thumb of rule, you should connect your power source (battery, AC/DC adapter, whatever...) to RAW and then supply power through VCC to all the remaining modules (as long as maximum current output and power dissipation in the regulator are respected). – Enric Blanco Apr 1 '17 at 14:01
3

Yes, you can do that as long as the total current draw of the modules you attach to VCC doesn't exceed the on-board regulator maximum current output.

The Arduino Pro Mini has a MIC5205 regulator capable of delivering up to 150 mA, which is quite low if you plan to attach many modules to its output. So you should look through your modules datasheets and find out the total current draw, including the Pro Mini board itself, and check that against the 150 mA limit.

According to the HC-SR04 datasheet, each module draws 15 mA. The Arduino Pro Mini itself draws about about 20 mA. The BLE module peak current consumption is 12.5 mA at active RX and 11 mA at active TX, so lets say 25 mA peak current draw for the BLE module.

Everything adds up to a worst case 105 mA peak current draw, within the maximum 150 mA limit. So it should be fine, but I would avoid connecting much more modules to that VCC rail.

MIC5205 on board the Arduino Pro Mini

ADDED according to your additional question:

If you run out of digital I/O pins, you can use the analog pins as digital pins if needed.

Additional note (thanks go to @jwpat7 for pointing this out in the comments):

However, this is true only of A0–A5 on most Uno and Nano Micro Arduinos, and not true of A6, A7 (except on -PB MCU models like ATmega168PB and ATmega328PB, where A6, A7 can be used as digital pins).

  • Alright! I added a bit more info also if you missed it (in case it changes anything in your resonse).I use a power distribution board that connects to my lipo battery/motor. The GND of the power distribution goes to the GND and the VIN goes to the "RAW" of the arduino pro mini. So my lipo 4s will power the arduino pro mini itself – Martman Apr 1 '17 at 13:46
  • If i try it out, can it harm/damage the arduino pro mini/the other modules? – Martman Apr 1 '17 at 13:48
  • Avoid using the data pins as supply rails for your modules, at any cost. It may work but it's a bad idea. – Enric Blanco Apr 1 '17 at 13:50
  • 1
    I see a lot of demos powering LEDs (~2-15ma) from GPIO, and a lot of modules (ADCs, DHTs, etc) use less than 1ma; "at all cost" is too broad imho; follow the datasheets and you're fine. – dandavis Apr 1 '17 at 15:09
  • 1
    “If you run out of digital I/O pins, you can use the analog pins as digital pins if needed”, is true only of A0–A5 on most Uno and Nano Micro Arduinos, and not true of A6, A7 [except on -PB MCU models like ATmega168PB and ATmega328PB, where A6, A7 can be used as digital pins] – James Waldby - jwpat7 Apr 2 '17 at 6:23
2

To be frank you can use even your analog pins as digital pins as the analog pins are also digital pins but they are more enhanced

If you use a common Vcc you may not have enough power left for your board and when you share your ground it doesn't matter a lot as it is the -ve lead of your power source and you may use an external power source

  • Ok. So sharing VCC can be problematic then but can work? If it doesnt work I assume breadboard is the only option left – Martman Apr 1 '17 at 13:33
  • I think it will not work – Sagnik Pradhan Apr 1 '17 at 13:35
  • Of course! This one: learn.adafruit.com/… – Martman Apr 1 '17 at 13:37
  • I think it will not work as you have tied too many things to a Mini board You may use an external battery or power source – Sagnik Pradhan Apr 1 '17 at 13:38
  • This is how I will setup the entire project: I use a power distribution board that connects to my lipo battery/motor. The GND of the power distribution goes to the GND and the VIN goes to the "RAW" of the arduino pro mini. On the "VCC" i have the BLE currently and that is where I also plan to put the hc-sr04 sensors – Martman Apr 1 '17 at 13:39

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.