- All
- Ambassador
- Personal
- Solaris
- Sun
Building your Sun Spot controlled Car
BITS Pilani, Goa, one of India's top engineering institutes, organized a 3 day Technical fest Quark 08.
A couple of friends(IRR, SVK) and myself participated in the All Terrain Transporter Robotics event.
We built a Sun Spot controlled car. One Spot was mounted on the car and controlled the various motors. We soldered 20 head pins to the lower side of the EdemoBoard and used a 20 pin cable to attach various pins to the electronic components. Another Spot was hand-held and controlled the Car.
The car was battery powered and ran using geared DC motors. The lifting hook was powered sing another motor. The body was built using aluminum sheets and 3mm plates.
To build this car, you will need the following
- 12V Lead Acid battery (1 no)
- L293D ICs (one IC can control 2 DC motors)
- Geared 12V DC motors
- 2 motor mountable wheels + 1 castor wheel.
I'm going ot go into the details of the electronics and the Spot. I'm sure you can create the car body.
DC Motors: These motors are basically continuously spinning motors that can turn in either direction depending on how the +12V and 0V of the battery are connected to its leads. For our purposes we used 12V 100 rpm geared DC motors.
L293D : These 16 pin ICs are usually used to control motors. The inputs it understands are 0v and 5V (logical 0 and 1). the output will be from 0 to Vs.
The pin connections we used were as follows
Pin 1,9,16 = +5V on Sun spot. +5V and Vh pins on the Sun spot also need to be shorted.
Pin 2,7 = Inputs to control left motor (Connect these to H0 and H1 from the Spot)
Pin 3,6 = Output for left motor. Connect the motor leads to these pins.
Pin 10,15 = Inputs to control right motor (Connect these to H2 and H3 from the Spot)
Pin 3,6 = Output for right motor. Connect the motor leads to these pins.
Pin 8 = +12V from lead acid battery
Pin 4,5,13,12 = the grounds from the Spot and the battery need to be connected to any of these.
The above connections will allow you to control 2 motors. However there are only 4 +5V pins on the Spot. If you want to control more motors using L293D ICs, you can use the GPIO pins D0-D5. These give out a signal of +3V, which can be amplified to +5 by using the below RTL inverter.
You can solder all of these on a PCB as below:
Now that we have the hardware figured out, we can easily take care of the software. The basic setup is as follows:
- The Spot on the car opens a server on the radio connection and waits for commands.
- It interprets incoming commands and switches on the pins H0-H3 and D0-D5 accordingly.
- The Spot in your hand goes in a loop and reads accelerometer values to figure out simple gestures. For example, turning the spot ahead can mean move the car forward, turning it left would mean turn the car left, etc.
- Send appropriate signals to the Spot on the car.
The code I wrote was quick and dirty, but it did the job. We now have a Spot controlled car in around 300 lines of code. It's available here. A tip to those who program Spots on Solaris using Netbeans.. make sure you use Java 1.5 (and not 1.6) when installing Netbeans.
Below is a video of our car in action. It was voted the most innovative car by the event organizers :)
Posted by anilg [Sun] ( February 16, 2008 11:11 PM ) Permalink | Comments[8]

![[Image]](http://www.play-hookey.com/digital/experiments/images/rtl_inverter_sch.gif)
Nice work Anil! Thanks for the excellent and insightful blog post! :)
Posted by Angad on February 17, 2008 at 01:41 AM IST #
Posted by Blog SPOT Blog ... on February 17, 2008 at 02:00 AM IST #
Hey great work,
However, I still don't get what is so great about a Sun Spot over some of the Atmel chips or Ti stuff as well ?
Regards,
Edward.
Posted by EdwardOCallaghan on February 17, 2008 at 09:58 AM IST #
Edwards, They are programmable using java.
Posted by Sun Spot. on February 17, 2008 at 07:25 PM IST #
Proton Dizayn; yetenekli web tasarımı uzmanları ve deneyimli teknik ekibi sayesinde sanatsal ruhunu teknik bilgisiyle birleştirerek, şirketinizin kurumsal kimliğini en uygun şekilde hedef kitlenize sunmakta, bilgiye ulaşmanın kolay olduğu etkili ve özgün web tasarımı projeleri tasarlamaktadır.
Proton is a professional web design company based in istanbul, offering high-quality websites and development services to clients in Turkey.
Proton specialise in website design, application development, content management systems, e-commerce solutions, intranet & extranet development, graphic design and digital multimedia.
Posted by Proton Dizayn on February 18, 2008 at 12:59 AM IST #
Anil,
The robot is really very impressive and your demo in the BOSUG meet was fantastic.
Congratulations!
Posted by Mayuresh on February 18, 2008 at 11:19 AM IST #
Slight correction here.. "Pin 3,6 = Output for right motor. Connect the motor leads to these pins.".. shouldn't this be 11,14? :)
Posted by Saurabh on February 20, 2008 at 12:00 AM IST #
This is so wicked cool :-)
Posted by Bina on April 21, 2008 at 08:03 AM IST #