Building a toxevo sensor
Building the sensor is really easy. In a nutshell, all you have to do is buy an Arduino microcontroller and flash our software on it.
None of the steps outlined here can break anything, even if you do make a mistake somewhere. If something fails, you can always retry from the last known good position or consult the troubleshooting section.
Let's go through it step by step.
1. Buy the microcontroller
toxevo uses the Arduino Nano 33 IoT board as the impact sensor.
You can find more information about the board here: Arduino Nano 33 IoT description on the Arduino website.
You can buy the board directly from the Arduino store: Arduino Nano 33 IoT on the Arduino store (they ship worldwide)
Make sure to buy the version without headers, especially if you want to use our 3d-printed case (see here).
Alternatively, there are a number of distributors who might have more in stock or better shipping options. You can find the list of distributors here: Arduino distributors
Not all distributors offer this particular model, but it should be easy enough to find a distributor in your region.
Again, the model you want to buy is the Arduino Nano 33 IoT in the variant without headers.
2. Flash the toxevo sensor program on your board
As said above, there is no way to break your board by flashing software to it. If something goes wrong, just retry from the last known good position. Worst case, you have to restart from the top and spent some time learning new things ;-)
There's also a troubleshooting section below, dealing with some common problems.
-
To flash the software to the board, you need the Arduino IDE (Integrated Development Environment). You can download it here: Arduino software
This tutorial will cover working with the Arduino IDE. It might work with the new Web Editor as well, but you're on your own there.
So, download the latest version of the Arduino IDE available (1.8.19 at the time of writing this tutorial).
-
Install the Arduino IDE. Make sure to also check the Install USB driver option during install.
The installation will prompt you for permission of some driver installations. Please allow those.
- Start up the newly installed Arduino IDE
- Grab a Micro-USB cable to connect the board to your PC. If you bought a non-Apple smartphone between 2010 and 2020, you'll most likely have a cable that fits.
-
Connect your board to the PC. A green LED light on your board will light up. This indicates that the board is receiving power from the PC.
You will most likely also see the orange LED blinking. This is just a default software the board comes with.
-
Most likely, your IDE will recognize the new device and prompt you to install supporting software for this board. If it does, please install it.
The installation will take a bit of time. Again, there will be a prompt to install some new drivers to your computer. Please install those as well.
- Similar to installing the board, it's possible that your IDE will tell you to update some of your libraries. Feel free to do that as well; it is not strictly necessary though.
- Download the toxevo sensor code from this link: Sensor code
- Unpack the zip file to a location you can remember
- Open the now unpacked impact-sensor/impact-sensor.ino file with the Arduino IDE
- In the menu bar, open Tools => Manage Libraries
-
Filter the list of libraries with the phrase RunningAverage.
Install the latest version of the RunningAverage library by Rob Tillaart.
-
Filter the list of libraries with the phrase RunningMedian.
Install the latest version of the RunningMedian library by Rob Tillaart.
- Close the library manager
-
From the main menu, select Tools => Board => Arduino SAMD (32-bits ARM Cortex-M+) Boards => Arduino Nano 33 IoT
-
From the main menu, select Tools => Port => COMX
Most certainly, there is just one port to select in this menu. Pick that one, no matter what COM number it has.
-
Press the Upload-Button in the Arduino IDE
-
Wait for the upload process to finish. It will take a few seconds.
- Uploading a new program can cause the Board to appear under a new Port. Please check in the main menu, select Tools => Port that a port is still selected.
- From the main menu, select Tools => Serial Monitor. A new window will open.
- In the Serial Monitor, select the baud rate 115200 (see next screenshot)
-
You should now see the following messages, indicating that your sensor is ready to play:
It is okay if it also says "No keepalive - restarting" at the end. That is part of normal operation.
Due to the restart mechanism, it is also okay to have to re-open the serial monitor again after setting the baud rate.
Please also check the Tools => Port setting before reopening the serial monitor.
-
If you are quick, you can carefully tap on the sensor right after opening the serial monitor to check if it can detect impacts. You'll se a corresponding message in the output and the orange LED activating for a few seconds.
-
If something went wrong along the way, you can retry any of the steps above. It's not possible to break your board by uploading software (or making a mistake while doing so).
If you're stuck, have a look at the troubleshooting section below.
-
Congratulations! Your sensor is now ready!
Download the toxevo software from the website and start shooting!
Get a 3D-printed case (optional)
You can find the case for the TOXEVO impact sensor on Thingiverse.
Pick one bottom, and print it together with the top. Push the Arduino board in, and click the two parts together.
Troubleshooting
The power LED does not glow when I plug in the board
- Make sure your cable is not broken. This is a problem more often then you'd think. Maybe try a different cable.
- Make sure the cable is solidly connected with your Arduino board.
- Try a different USB port on your PC.
- Check the serial monitor in your Arduino IDE. Maybe the board works, but the LED is broken? It happens!
The IDE says Board at COMX is not available
From the main menu, make sure to select a port at Tools => Port => COMX.
It's possible you have to select it again after some steps.