Touch sensor Part 2

Hey guys

So last week I explained why I bought a touch sensor, how I connected it up to Sparki and how I used the touch sensor to increase the opportunities for direct physical communication and interaction with Sparki. You can find the article here.

This week I’ll explain how I used the touch sensor to help Sparki navigate around the room. As some of you may know, my ultrasonic range finder is currently not working ( so for the time being Sparki has been unable to be autonomous in his movements…until now!

I moved Sparki’s gripper in so that it could be used to support the touch sensor at the very front of Sparki’s body (which is held in place by the very technical blu-tac) and then I wrote a program that would allow Sparki to move Forward regular intervals unless he was touching an obstacle. At which point he reverses 5 and moves Right 90 degree angle:

#include <Sparki.h>  // include the sparki library

void setup()
void loop()
         int touch= analogRead(8);

As you can tell this is a really simple code but it works effectively to give Sparki some degree of autonomy for now and is a great, practical use for a touch sensor 🙂

Of course by setting up each turn (when Sparki had encountered an obstacle) as a different variable, it would be possible to complete much more complex navigating programs with this touch sensor.


I hope that Sparki’s exploration of touch sensors was helpful!? Let me know what you think 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s