-
1Solder components
Solder each pair of IR LED's and sensors to one of the single ethernet ports: red leads (+) to pin 1, black leads (ground) to pin 2, one yellow lead (sensor 1) to pin 3 and the other yellow lead (sensor 2) to pin 4.
Solder a jumper wire to the corresponding pin on the 6-way ethernet port for each sensor, and a normal wire each for + and ground. WARNING: ETHERNET PINS DO NOT ALWAYS MATCH UP BETWEEN BRANDS SO CHECK THE CONNECTIONS WITH A MULTIMETER!!
Solder jumper wire to each LED anode pin, and a 330 ohm resistor to the cathode pin; then a wire to the resistor.
Jumper wires make it easy to connect to the Arduino I/O pins, but there aren't sufficient ground or 5V pins, so you need to use normal wires, then solder those together.
Any exposed regions can be shielded with heat-shrink tubing or electrical tape if there is any concern of movement/contacting other bits.
-
2Connect to Arduino
Plug the collated ground wires into the Arduino Ground pin and the collated + wires in the Arduino 5V pin. Then plug the other jumper wires into the correct I/O pins:
Pilot LED's - 2-13 (in order)
IR sensors - 22-45 (in order of sensor pairs)
-
3Upload code
Download the .ino file and upload the code to your Arduino Mega.
-
4Make sensor holders
Print 4 sensor holders for each cage (ie. one each for every IR LED or sensor). There are 2 .stl files included in the project - one as pictured to hang from the rail on a Tecniplast cage, the other has a hole for gluing in a neodymium magnet to allow for magnetic attachment. The sensors can then be slotted ready for placement on the mouse cage.
-
5Connect sensors
Plug the ethernet cables in to the correct ports to connect each pair of sensors in order.
-
6Set up the terminal program
Download and install "Putty" on the computer that is connected to Arduino. This is an open-source terminal program that will log data from the Arduino into a .csv file.
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
-
7Start recording
Set the terminal program to log data with a data transfer rate of 115200. You need to set the correct "COM" port for the Arduino (check "Devices" in your control panel). Name your file and press "Open". The program should start recording.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.