Arcbotics SparkiThe Arcbotics Sparki module provides an interface to the Arcbotics Sparki robot. Sparki is a very capable robot that is great for beginners to learn about robotics and great fun for advanced folks to test their programming capabilities. Sparki is loaded with sensors and motors that provide a very rich environment to work in. In addition, a bluetooth module that allows Sparki to communicate to a PC wirelessly makes a great addition to the suite of abilities.
The RoboRealm module provides access to all these abilities in a graphical way such that you can test and learn more about what the sensors do and when they work best.
Sparki's 'brain' is based on the Arudino microcontroller. In order for RoboRealm to successfully communicate with Sparki you need to download the sketch program file that will need to be uploaded to the robot before the RoboRealm module can communicate with Sparki. You can also use this file as another example of how to program the onboard Arudino to access the various components of Sparki.
Download the RoboRealm Sparki Sketch that needs to be compiled and uploaded into your Sparki before this module will become active. This sketch provides a communication protocol over serial to Sparki from the PC. Note that it is highly recommended to start with a connected USB cable to Sparki as the serial method. Once you have verified correct operation you can then switch to bluetooth by selecting the different serial port AND baud rate (note, that Bluetooth communication is only 9600 baud).
With the USB cable connected to Sparki and previously mentioned sketch program being uploaded, you should then select the right COM port with the baud rate set to 115200. Once this is done, select the checkbox to enable to accelerometer interface. You should see numbers changing on the right of that image with the image moving to illustrate what the numbers are showing. If you now pick up or tilt/twist Sparki you should see the image change accordingly.
The checkboxes located in many of the interface areas allow you to selectively decide what information you want to receive. This is done is order to reduce the overall communication overhead with Sparki to ensure quick response. As many configurations do not require all sensor information from Sparki these checkboxes can be used to effectively reduce the communication and processing load on Sparki.
- Download and install the Arcbotics SparkiDuino Application.
- Download our RoboRealm Sparki Sketch files.
- Unzip this into a folder that you can remember.
- Load in the ArcBotics_Sparki.ino file into Sparkduino
- Upload that to Sparki over a USB connected cable (press the right arrow button).
- Run RoboRealm.
- Click on the Search tab (upper left corner) and type in Sparki. Double click the results to insert that module into the pipeline.
- Select the appropriate COM port, enable the accelerometer checkbox and see if you get movement when touching Sparki.
1. COM Port - Specify the COM port that Sparki is connected to. Note that Sparki comes with a USB cable that simulates a serial port on your PC. The port number for these kinds of virtual ports are normally above the standard 1-4 physical ports.
2. Baud Rate - Specify the baud rate of 115200 to communicate with Sparki. Note that this is much higher than the standard 9600 normally used. The higher rate provides much better responsiveness than the lower rates. If you plan to use bluetooth the default rate is 9600 which will be much slower than a USB connection.
3. Remember As Default - Select the "Remember as Default" checkbox if you would like the current COM setting to be remembered by RoboRealm such that whenever a Sparki module is inserted into the RoboRealm pipeline the COM port and baud rate will be auto-populated to the current setting. This ability allows you to not have to constantly change the COM port setting when loading in successive RoboRealm robofile configurations as long as the connection properties remain the same.
4. Motors - Once communications is specified you should be able to move the appropriate slider in order to see the wheels move. If the motor does not move, check your USB connection and battery switch. To learn more about Sparki's wheels see the Sparki Wheel Parts.
5. Variables - Select the appropriate variables that contain or will contain the position value that will be sent to the motors. This is used to automatically change the motor values based on your VBScript (using the SetVariable function) or Plugin based program or Joystick or any other module that is used to update variables. See Variable Control for more information on how to programatically move the robot.
6. Current Value - To manually set the motor position, type in the appropriate number (-100 to 100, 0 is the default neutral) into the text area or use the slider to adjust the value. The motor speed will be updated as appropriate.
7. Sliders - You should be able to move your motors by dragging the sliders to the right or left or by specifying a number within the current value text box. If the motors do not move check your USB cable and/or board power connections.
9. Min/Max Limits - You can also use the min/max limits to ensure that even if the variables specify large or low values (due to programming errors) that the board does not actually attempt to move the motors above or below the specified limits. This can be used as an additional precaution in case your motors cannot physically move beyond certain limits.
10. LED - The led is a full color LED capable of generating a lot of colors. You can use the spin buttons or type in a number in the provided text boxes to see an immediate change in the LED. The 3 channels (red, green and blue) can be used in combination to specify many colors. Note that when a variable is selected the value field will be disabled to indicate that the specific LED channel value is now being received from a variable. To learn more about Sparki's LED see the Sparki LED Part.
11 Accelerometer - The 3 axis accelerometer provides orientation information for Sparki. To enable this functionality click on the checkbox next to "Accelerometer" which will enable receiving of orientation information. The X and Y values indicate roll and tilt with the Z axis being a check to determine if the robot is upside down. Keep in mind that the Accelerometer only measures tilt and NOT orientation (that's what the compass is used for). The values are stored in 3 variables that can be accessed by other modules (SPARKI_X_AXIS, SPARKI_Y_AXIS, SPARKI_Z_AXIS) for you to use.
Note that the simulation graphic uses the X Axis1 and Y Axis for tilt sensing and checks the Z Axis to determine if the robot is upside down. Keep in mind that the Accelerometer only measures tilt and NOT orientation (Z axis) and thus the simulation graphic will assume you are holding the robot with the LCD screen towards you and the sonar pointing away.
To learn more about Sparki's Accelerometer see the Sparki Accelerometer Part.
12. Smooth - If the accelerometer values are not as responsive as you would like try reducing the smooth value. This will allow the numbers to be much more reactive but may also cause some unwanted jitter due to noise in the determined values. By decreasing the smooth value you make the sensors much more responsive to movement, increasing the value will delay the sharpness of the movement but also make it much more smooth. Note this is reflected in the simulation graphic.
13. Gripper - To open/close/stop the gripper manually click on the appropriate radio button. In order to allow for this feature to be programmed, you can type in a variable that holds the value 'open' or 'close' or 'stop' which will then command the gripper to that state. This allows you to trigger the gripper movement based on some other module. The gripper motor will activate for a short period of time and then stop to avoid over burdening the motor. The timing should be sufficient for fully opening and closing the gripper. To learn more about Sparki's Gripper see the Sparki Gripper Part.
14. IR Remote - You can receive button press information from the IR remote control that is included in your Sparki purchase. To enable this functionality click on the checkbox next to "IR Remote" which will enable receiving of IR remote information. When enabled, you can press a button on the IR remote and that corresponding button name will appear in the interface. You can then select or type in a variable that will also be set to that button to use this information in other modules. To learn more about Sparki's IR Remote Sensor see the Sparki Infrared Remote Part.
15. LCD - Sparki comes equipped with a 128 x 64 pixel blue and white LCD screen. This can be controlled individually as pixels or as text. If you select the 'Text Variable' radio button and type in a variable that contains some text (for example the IMAGE_COUNT variable) you will see that text represented in the simulated LCD screen but also transmitted to Sparki too. You can also select a 'Graphic Image' to be used instead. When a 'Graphic Image' is selected this will cause the current image loaded in RoboRealm (including any webcam image currently active) to be reduced in size, dithered and sent over to Sparki such that the blue and white LCD will then display to image. Keep in mind that while the connection to Sparki is fast and the image is small, it cannot keep up with most webcams so you will notice some lag.
If you prefer to create your own custom screens you can use the Resize Canvas module to change the image within RoboRealm to a 128 by 64 pixel image and then use the display modules to draw your own graphics on that image. Sending this to Sparki will then reflect that screen on Sparki's LCD panel. Keep in mind that Sparki's screen is two color (white or blue) which means images may not appear as they do on your monitor.
To learn more about Sparki's LCD see the Sparki LCD Part.
16. Radar - The most striking feature of Sparki is the sonar sensor mounted ontop of a servo. This gives Sparki a personality by emulating a robots head. The combination of a sonar sensor mounted onto of a servo allows for the sonar to move and scan in the environment.
To enable sonar scanning click on the checkbox next to "Radar" which will enable the movement of the servo and receiving of distance information generated by the sonar. This information will be graphically displayed as the sonar sweeps through its range. Note that because the sonar is a point sensor, only part of the radar map will be updated at any particular time. The red dots shown just beyond the distance information indicates where the sonar is currently aiming.
The dark areas near the center of the radar are assumed to be obstacle free. The values that show color are objects that blocked the sonars scan and thus are considered to be obstacles.
The distance information is represented as "cm" and provided in an array of values when you type in or select a variable next to the "Distance Array" text. This variable will then contain all the information that is used to create the radar graphic and can be further analyzed to determine an obstacle free path.
To learn more about Sparki's Ranger see the Sparki Ultrasonic Range Finder Part.
16.Line Detectors - Sparki comes equipped with 5 line sensors located just under the gripper. These sensors are IR based and produce a value that indicates how much IR light they are receiving based on how much IR is reflected from the surface that Sparki is currently on. These values will differ based on the intensity of the surface, lower values for dark surfaces, higher values for lighter surfaces. Using the differences in values you can determine how to move Sparki to keep on the line.
To enable this functionality click on the checkbox next to "Line Detectors" which will enable receiving of line intensity information. The blue indicators will show the sensed values with the 'Current Value' box showing the actual number. To perform calculations on these numbers select or type in a variable that will be set to that value. These variables can then be used to perform calculations in other modules.
To learn more about Sparki's Infrared Reflectance Sensors see the Sparki Infrared Reflectance Sensor Part.
17. Light Sensors - Similar to the line sensors, Sparki also has light sensors mounted in the front to detect light intensity. These controls have similar functionality to the Line Detectors. Once you activate these sensors you can use a flashlight to shine across the front of Sparki to see these values change. To learn more about Sparki's Light Sensors see the Sparki Light Sensor Part.
18. Play Song - You can quickly select a song and press play to hear Sparki play a quick melody. To automate the playback of songs select a variable that will contain the song name as seen in the dropdown. Note that after the song begins playing the variable is cleared to avoid repeating the song. To add your own songs you can edit the "Music.rtttl" file in the RoboRealm folder. This file contains RTTTL formatted melodies which are converted and sent to Sparki for playback. Note that the RTTTL format is the Nokia Cell Phone ringtone format and can be found for free in many sites.
Be aware that while Sparki is playing the tone the robot is unable to complete any other tasks. Playing a song requires the full attention of Sparki and thus will become unresponsive to other commands while the song is playing.
To learn more about Sparki's Buzzer see the Sparki Buzzer Part.
Click Here to download an example that shows how you can move Sparki using a Joystick. You will have to edit (double click) on the Joystick module to ensure your joystick is connected and the Sparki module to ensure that the correct COM port is selected. You can also press button 1 on your joystick to close the gripper and button 2 to open it. If you'd like to use different buttons you can reconfigure this by editing the Joystick module and moving the variable from button 1 and 2 to some other button.
SPARKI_X_AXIS - X axis accelerometer value SPARKI_Y_AXIS - Y axis accelerometer value SPARKI_Z_AXIS - Z axis accelerometer value
BirdBrain Technologies Finch Robot
For more information
Arcbotics Sparki Website
| New Post
|Arcbotics_Sparki Related Forum Posts
Sparki Bluetooth communication
Is it possible to use the Sparki Bluetooth module to display Sparki sensor data in RoboRealm and can it be recorded?
I've just downloaded the software to run with the Sparki Robot. I've installed the new header files as recommended,...
Sparki: Accelerometer does not name a type
I reloaded SparkiDuino a couple of hours ago. From ...