Bluetooth shield not working when battery powered.

Hello all,

I'm trying to create an RC transmitter that is partially based on a USB host shield 2.0. The device I want to connect is a PS4 controller through a bluetooth dongle. Everything works as expected when the arduino is powered up while being connected to the computer using USB.

I've since attached a battery and have found that everything continues to work when the USB is disconnected to the computer.

The confusing part is that when the arduino is powered up from the battery without the USB plugged into the computer it no longer connects to the PS4 controller.

The example code for controlling the PS4 controller has a commented line about USB CDC serial connection.

I was wondering if anybody could explain why the Arduino must communicate with the PC before the bluetooth shield can work properly and if there is any work around so I can connect the controller without needing a computer.

Here is the github site that includes libraries and examples I'm working from as well as info about the bluetooth shield I'm using. GitHub - felis/USB_Host_Shield_2.0: Revision 2.0 of USB Host Library for Arduino.

Thank you!

marcopolo1994:
Everything works as expected when the arduino is powered up while being connected to the computer using USB.

I’ve since attached a battery and have found that everything continues to work when the USB is disconnected to the computer.

The confusing part is that when the arduino is powered up from the battery without the USB plugged into the computer it no longer connects to the PS4 controller.

The power demand of HC-0x varies according to what its state is, and I believe it is quite high when it is making a connection. This might explain the above, and the battery is marginal. Please don’t tell us it is a 9v PP3.

Thank you for the suggestion, I was using a 9v pp3. I tried switching to a 2S NiMH RC car battery which should have much higher current and there was no difference. The bluetooth shield doesn't require an external power hookup so I can't imagine it's drawing too much current from the arduino. I also tried powering the cord through the DC jack as well as Vin. It still only begins to pair when it is powered from the USB cable (both when it is connected to my computer or from a wall wort)

I don’t know quite what you mean by a shield but, you are right, the demand is not that great. Nonetheless, I think power is the problem, and your understanding of it is where the problem lies. I only say “think” because what you are doing, and what you mean by shield, are far from clear.

If you really are using a shield, you don’t normally get a choice of how it is powered, and it is hard to get it wrong. If you really mean a Bluetooth module, you can get it wrong. It should be powered off the 5v pin, and it appears that you didn’t do that, indeed you took two other options, both of which are likely to have been fatal.

marcopolo1994:
I also tried powering the cord through the DC jack as well as Vin.

So, do you see any flashing LEDs now? You might find the following background notes useful.

Here is a link to the product I'm using. It is a shield that piggy backs directly onto the arduino uno. My understanding is that as long as the arduino is receiving a proper power supply, either from USB, DC jack, or Vin the shield should work.

However, this particular code only runs when it is powered through the USB cable. Interestingly, I hooked up 3 AA batteries in series to get about 4.2 V and soldered those leads to the arduino that corresponded to the +5V and gnd terminals of the USB plug. The code worked!

My workaround will likely be to use a voltage regulator to step down the current from the 9V battery to 5V and connect it directly to the USB power pins on the board. Crude but I think it will work.

I'm starting to think that the code and libraries I'm using are checking to make sure that the USB is powered before running. Unfortunately I'm fairly new to this so I had a hard time parsing out the .h files that are running in the background of the code and I don't understand the hardware well enough to figure out why there would be differences between the way you power your arduino in relation to getting this shield working.

OK, the link is missing but you describe a shield and, with the exception your understanding of:

  1. the word "proper" and
  2. the difference between volts and power, and I guess
  3. the difference between "proper" and "lucky"
    the rest is about right, and goes quite some way to explain why everything works properly when you use a USB cable. The rest of the post is nonsense and, if you insist on using a 9v PP3, you deserve all the grief you will get, and that will probably be sooner rather than later. I don't know what parsing means, I always have to ask my wife but I won't this time, as I bet you don't have to do it to any .h files.

Power supply requirements are pretty clear. You may apply a kosher 5v to 5v or via USB. I think VIN is a take-off, not a supply, and 5v there goes through the regulator. You may get lucky and get by with 4.5v, but 5v is 5v, so don't be surprised if your luck runs out. About the only good thing to be said about 3xAA is the you won't fry anything. Power is something you have not considered. You don't need much, but a 9v PP3 has virtually none at all.

The 2S battery, properly charged, should be OK on the barrel jack, so I don't have an explanation for that. You will find plenty of battery stuff from people around here who are a lot more expert than me. Not much of it will be on 9v PP3.

Be aware that Uno is not the greatest choice for battery power. It is fine to prove the point, and that may be all you need.

Thanks for the help! Here's the missing shield link if you're interested,

and by parsing I just meant reading through and fully understanding all the linked library files. Sounds like if things don't work out the next thing to do is get a proper battery to supply the arduino!

marcopolo1994:
Sounds like if things don't work out the next thing to do is get a proper battery to supply the arduino!

You're dead right about that...
You will be amazed how often inadequate power turns out to be the problem - hence my comment. I guess this is because of all those pictures you see on Google of Arduinos connected to 9v PP3 batteries. There is even a fair chance that the project shown isn't really powered by PP3, it is just a convenient representation from the Fritzing parts bin.

The point of libraries is that you don't need to know what is in them, you just need to know what they do. The included examples tell you that.