Forum

Controlling Servo w...
 
Notifications
Clear all

Controlling Servo with BT

9 Posts
5 Users
0 Likes
1,181 Views
Posts: 7
Topic starter
(@hoffmant)
Active Member
Joined: 2 years ago

We've been able to follow the tutorials to get a simple BT app working and connecting our arduino to an App Inventor app.

However, when we try to write code to control a servo, it'll work (move the servo) once, then we get a "broken pipe" error on the App Inventor app.

The best we can figure is that the servo might be drawing too much power and it is resetting the bluetooth module? We've tried powering it with a laptop usb port (we can read the serial input/output this way) and with the battery pack we were sent. We even tried using a larger battery pack with no success. 

Will the servo need to have its own power source? Any other suggestions?

8 Replies
Posts: 23
Admin
(@compase)
Member
Joined: 16 years ago

First thoughts: Drawing too much power is possible, but it could be something else. These types of servos can draw up to 750mA (typically less but we haven't measured). The HC-05 Bluetooth only draws around 40mA. The power supply on the Arduino Nano Every, the MPM3610, should be able to supply up to 1.2A on the 5v pin ( https://www.monolithicpower.com/en/documentview/productdocument/index/version/2/document_type/Datasheet/lang/en/sku/MPM3610GQV-Z/document_id/2090). So, you should be within the Nano Every's limits. 

Have you tried a smaller angular movement with the servo to see if that works?

Note that if you're using an Arduino Uno or the original Nano, you're much more likely to draw too much power. 

We were concerned about this possibility, though, with all the sensors we've given you. Our plan is to show -- with one of our tutorials -- how to create a separate 5v power rail with the USB battery to power the servo separately. 

 

Reply
Posts: 7
Topic starter
(@hoffmant)
Active Member
Joined: 2 years ago

We had been using a Nano. We have a few different students working on different parts of the puzzle, so we were using Nanos we have on hand to build circuits & test code.

I tried replacing the Nano with the Every and am having the same problem, though. It's still throwing a "Broken Pipe" error after the servo moves once.

Reply
1 Reply
(@hapkidon)
Joined: 2 years ago

Active Member
Posts: 5

@hoffmant   We've not hooked up the servo yet, but can do next to see if we have the same issue. As mentioned above  a separate power supply would work (if it's a power problem)    Here a good link I found on the topic.  The key to multiple power supplies is that they all share the same ground connection.

https://electronics.stackexchange.com/questions/64415/arduino-nano-this-schematic-would-work

As usb power supplies are 5V,  if you are confident,  you can modify a cable to get 5V directly and power the servo and nano on the usb without the servo drawing power from the nano.  We've done this for neopixel strips before , we'll test it out on the servo as well

Don

 

Reply
Posts: 5
(@hapkidon)
Active Member
Joined: 2 years ago

@hoffmant 

 following up from last night, our coder was able he servo to work over bluetooth when the nano was plugged into the computer via USB. 

Reply
2 Replies
(@hoffmant)
Joined: 2 years ago

Active Member
Posts: 7

@hapkidon Could you share any code or setup tips? We still haven't had success with this.

 

Thank you!

Reply
(@nerdlord)
Joined: 2 years ago

New Member
Posts: 3

@hoffmant Hello there! I'm the programmer from @hapkidon's team (Golda Meir School). Here is some simple code based on our working project, with the Bluetooth module attached to pins 3(TX) and 2(RX) and a servo attached to pin D9, GND and 3V3. Assuming you have a functional Bluetooth connection in MIT app inventor or a mobile app of your development, just send the character "s" via Bluetooth to trigger the servo. From here, this is very customizable. However, one major restriction is that I have traded readability for performance in the way I transmit things from the phone to the Arduino. Due to this, the text you send can only be one character at a time.

Reply
Posts: 8
Moderator
(@bobbruch-2)
Member
Joined: 2 years ago

We are also having some trouble with this but it has been erratic.

We had the BT and the servo working great for a while but after several days of work we could only run the BT when the servo was unplugged. 

 

We were about to bring in 5v from an outside power supply but now the BT doesn't seem to work at all anymore.  (We'll be making a post about the BT module elsewhere)

Reply
Page 1 / 2