Author Topic: My first Digispark project: IPCamBot - Digispark, Bluetooth and an IPCam  (Read 12844 times)

deejayspinz

  • Newbie
  • *
  • Posts: 12

 What better way to put a Digispark to use than to build a small robot that can navigate small places and show a video stream from an IPCam.  The Digispark worked well for this challenge.  I wanted to build a robot that was small, could be controlled by Bluetooth and would be able to stream a video so I could remotely control it without seeing it.  IPCamBot uses a digispark paired to the motor shield to drive 2 modified micro servos mated to a LEGO track base.  I also used a DX JY-MCU
Bluetooth module (others should work too) to link to BTBotControl (an Android app that I custom built).  For video, I am using an Ai-Ball tiny IPCam.  Between the motor sheild and Bluetooth, all available pins were used up, so I had to resort to manually connecting the LED.  In the future, I may decide to upgrade to an Atmeg328 so I can put a light sensor to trigger the LED on/off. 
 
 
 I've got 2x 18650 batteries wired up for this sucker - cause the camera and LED suck a lot of juice from it.   The Ai-Ball pulls 300mA itself alone.    More details, picture and sample Arduino code for connecting to Bluetooth and parsing string data can be found on my blog - Plastibots.




« Last Edit: March 17, 2013, 05:57:20 am by deejayspinz »

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
what's the motor shield for? if you're using continuous rotation servos you just hook them up to one data pin each, surely? I'm a little perplexed about how you ran out of pins. two servos plus serial rx&tx is four pins, then a light sensor and led are six, right?


there are some neat tricks you can do to use an LED asa light sensor too, but they only work while not using it as a light momentarily, which might cause some vertical tearing on your camera, not too sure.

deejayspinz

  • Newbie
  • *
  • Posts: 12
what's the motor shield for? if you're using continuous rotation servos you just hook them up to one data pin each, surely? I'm a little perplexed about how you ran out of pins. two servos plus serial rx&tx is four pins, then a light sensor and led are six, right?


there are some neat tricks you can do to use an LED asa light sensor too, but they only work while not using it as a light momentarily, which might cause some vertical tearing on your camera, not too sure.


How do you reverse the motors then?  The motor shield supports motor reversing - 2 pins for the motors, 2 pins each for motor A/B fwd/rev.  That's 4 pins. Motors are also being driven at 9V.
Bluetooth RX/TX uses the last 2 pins.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
If you use continuous modified servos, you leave the motors connected to the little controller inside and disconnect the potentiometer. You then use a servo library on digispark or whatever to set them to the absolute middle position and twist the little potentiometer inside until they stop turning. Add some super glue or clear nail polish or something like that and close it back up. Now when you pulse above the middle number it'll go one way, and below goes the other way, and how far above/below controls speed! Uses just one data pin per servo, and if you need to drive a whole bunch of servos you can do that with PPM and use a hobby demuxer thingy to split it out to each servo channel. PPM effectively combines the signals of several servos in to one wire - it's how radio control stuff transmits the values of all of the servos and servo-like things through just one radio channel, so there's lots of gear that can decode it.


If that explanation was confusing, youtube has your back

deejayspinz

  • Newbie
  • *
  • Posts: 12
I follow.  Thx for the tip.  In this case,  I stripped out all the electronics and wired directly to the motors.  They are only a few bux at DX, so I might p/u a couple more and try this.

Mark

  • Full Member
  • ***
  • Posts: 196
There are continuous rotation servos available at many sites.


Mark

dougal

  • Sr. Member
  • ****
  • Posts: 289
Where you get that IPcam? Most of the ones I'm turning up in searches are security cameras, and way too big.


deejayspinz

  • Newbie
  • *
  • Posts: 12
Where you get that IPcam? Most of the ones I'm turning up in searches are security cameras, and way too big.

Ebay  ai-ball.  Be warned that these suckers eat batteries.   They also get very warm. They draw about 300mAh.  However, I've gone through fresh batteries in 10-15 mins.   I've got mine running on 2x 18650 2500mAh batteries now (along with the rest of the robot bits) -which gives me much longer run times.  Necessary for when I send this sucker into my ducts.
« Last Edit: March 22, 2013, 04:22:16 pm by deejayspinz »

dougal

  • Sr. Member
  • ****
  • Posts: 289
Thanks for the tip, I ordered one a couple of days ago!