How to build a gesture-controlled car
A distant drive
Today is Thursday, in case you needed reminding. By now you’ve probably rewatched the entirety of Netflix, Prime & Hotstar put together twice. You’ve also covered every online course, webinar, session covering every possible domain that intrigues you be it cooking or coding. Well what if I told you I could give you a glimpse of your past & future in your present? Confused? Don’t worry, this is not one of those cliched and conventional muses of motivation.
Remember those good old days of childhood, when the thrill of toys loomed in our lives. Remote controlled cars used to be one of my favourites. Gone are those days where cars need to be controlled anymore, since we’re moving towards an era of self-driven cars and automated transportation. Well, the future is filled with technology that is more intuitive and immersive resulting in an effortless man-machine interaction. So I thought why not integrate a piece of the past with a figment of the future. Considering the corona factor into this, I thought of picking up a piece of technology which would instill the distance into my drive after all this is the new normal right?
Before you get caught up in this time travel, let me cut to the chase. I’ll be taking inspiration from an age-old remote-controlled car and integrating it with futuristic gesture-controlled technology.
The following course of instructions will not only enable you to assemble this seamlessly simple setup but also fetch you a flavour of the future at your fingertips.
To achieve the aforementioned, you’ll require the following components:
The nRF52832 is Nordic Semiconductor's multiprotocol radio system-on-chip (SoC). It's a half microcontroller, with features including 32 configurable I/O pins and supports Bluetooth low energy (BLE), ANT and ultra low-power wireless communication. We’ll be using the board as a receiver for the data transmitted from the KAI via Bluetooth communication which thereby helps us navigate our car.
A DIY kit consisting of all the basic components you require to build your mechanical platform of the car inclusive of motors, wheels, chassis, breadboard, jumper wires, nut & bolts etc. You can even use any one of the readymade robot kits which have the entire hardware setup of the chassis integrated with the motors which just require the addition of your specific electronics.
3. Power Supply
A 9V battery accompanied with a voltage regulator LM7805 Voltage Regulator IC. A regulated power supply is very much essential for several electronic devices as it may get damaged if there is any deviation from the fixed rate of current or voltage. Here comes the 7805 Voltage Regulator IC to the rescue. It is an IC in the 78XX family of linear voltage regulators that produce a regulated 5V as output.
4. L293D IC
The L293D is a popular 16-Pin Motor Driver IC. As the name suggests it is mainly used to drive motors and is capable of running two DC motors at the same time; also the direction of these two motors can be controlled independently.
The KAI, powered by the Vicara Motion Engine is a wearable gesture controller that lets you interact with the digital surroundings around you, using your hand gestures. The product is essentially a wearable that uses sensors to sense the movement of your hand and fingers. It can be integrated with an application of your choice by just clicking a button on the Control Centre and can also be completely customised. In this case, we’ll be limiting our usage of the KAI as a steering wheel for our ride.
We’ll be using gestures made with our 4 fingers (excluding the thumb) to control the car. With the Kai on our palm, the data collected from the specific movement of our fingers is dynamically tracked and sent via Bluetooth communication to the receiver module on the car which thereby directs the motors and drives the car in the desired direction.
- To start with the power, connect your power source Vin with the voltage regulator. LM 7805 consists of 3 pins, an input, ground and output.
INPUT — Pin 1 is the INPUT Pin. A positive unregulated voltage is given as input to this pin. GROUND — Pin 2 is the GROUND Pin. It is common to both Input and Output. OUTPUT — Pin 3 is the OUTPUT Pin. The output regulated 5V is taken at this pin of the IC.
2. The back side of the nRF52832 Breakout is filled with jumpers to help you customize the operation of your board. They’re labeled with an abbreviation of their purpose. To program the chip, and to use any of the nRF52832’s 32 I/O, you’ll need to solder something to its headers. We suggest soldering right-angle male headers or straight male headers onto the six-pin serial header to enable an easy interface. The remaining two rows of the board are breadboard-compatible, so you can solder male pins into both and have it fixated onto a breadboard. Once you’ve finished this, you can connect the Vin pin with the output pin of the voltage regulator and the ground pin to the common ground on the breadboard.
3. Using the L293D motor driver IC is very simple which works on the principle of a Half H-Bridge. As mentioned earlier this IC is capable of running two motors at any direction at the same time. All the ground pins need to be grounded. There are two power pins for this IC, one is the Vss(Vcc1) which provides the voltage for the IC to work, this must be connected to 5V from the voltage regulator. The other is Vs(Vcc2) which provides voltage for the motors to run, based on the specification of your motor you can connect this pin to anywhere between 4.5V to 36V, in this case it’ll be 9V since we’ve taken a battery of that rating.
4. Let’s delve into the connections of the IC :
Pin 1: This pin enables the input pin (2) & (7), i.e the motor connected these pins will rotate. Since we’re using 2 motors, the pin is held high by default connecting to the 5V supply.
Pin 2: This pin has to be connected with the digital circuit, so connect it to Pin 3 of the breakout board.
Pin 3: Connect this to one end of the motor.
Pin 4 & Pin 5: These are connected to the ground of the circuit.
Pin 6: This is connected to another end of the motor.
Pin 7: Connect this to Pin 11 of the breakout board.
Pin 8: This is the Vcc2 which has to connected to the 9V supply
Pin 9: This pin enables the input pin (10) & (15) & the motor connected to these pins will rotate.
Pin 10: Connect this to Pin 4 of the breakout board.
Pin 11: This pin has to be connected with one end of the second motor.
Pin 12 & Pin 13: These have to be connected to the ground of the circuit.
Pin 14: This is connected to the other end of the motor.
Pin 15: Connect this pin to the Pin 5 of the breakout board.
Pin 16: This is Vcc1 which has to be connected to +5V from the voltage regulator
5. Once you’re done with all the aforementioned connections, we move onto the remaining connections on the breakout board.
- Connect the VIN to +5V from the voltage regulator
- The ground pin has to be connected to the common ground of the circuit
- Pin 2 & 19 have to be connected to Pins 1 & 9 of the IC respectively
Now you’re all set with your setup and ready to race to the final segment of this project. Download the segger embedded studio which is a user friendly IDE, to run the code which will enable you to get the entire project running. The specific code for this project is available for all the users of Kai. In case you’ve not purchased Kai yet, do go ahead and get one out here. Once you’ve bought yourself a Kai, all you’ve got to do is get the entire setup of the project ready & upload the code onto the board using the IDE. After that, the breakout board looks out for the Kai and if the Kai is on and advertising itself, the board automatically connects to it. Go begin your very own gesture-controlled ride.
Following are the directions for controlling your car with your hand gestures:
- Tilting your hand upwards results in a forward motion of the car
- Tilting your hand downwards results in the backward motion
- Closing the fist results in continuous motion in the existing direction
- Tilting your hand left, results the car to move in the left direction
- Tilting your hand right, makes it go in the in the right direction
These movements are characterised by the present thresholds specified in the program which determine the YPR data obtained by Kai & transmit these to the board via Bluetooth. Put on your seatbelt and gear up for an adventure with your actions, cause you’re about to gain a lot of traction!