-
Notifications
You must be signed in to change notification settings - Fork 24
Notes on sensors and actuators
The ultrasonic sensors communicate via a serial bus protocol, which requires each sensor to have a unique address.
All the sensors come by default with a preset address (same for all sensors). In order to enable communication, one of the two ultrasonic sensors in the car has to change its address. The following procedure will cover the necessary steps to do so; as these sensors are connected to the Beaglebone board, the entire procedure needs to be carried out after SSHing into the aforementioned board.
Run the following command to check the I2C connection on bus n. 1
i2cdetect -r 1
(Type Y when seeing the warning)
A single "70" should appear in the hexadecimal address table, meaning that it is the address of both ultrasonic sensors (if two addresses are shown then the sensors are ready to go without further operations).
Unplug one of the two sensors and run the same command again: the 0x70
should still be there, which needs to be reassigned to another address.
Download or copy the devantech_change_addr.cpp file into the board and compile it with the command g++ --std=c++11 -o dev_ch_addr devantech_change_addr.cpp
, then run the resulting binary with the following arguments ./dev_ch_addr 1 0x70 0x71
Check the address with the i2cdetect -r 1
command as before, and the address should now be changed to 0x71
.
Plug in the other sensor and run i2cdetect -r 1
again to verify that the table contains two different addresses, now identifying the two different sensors.
For additional details on the command and the ultrasonic board LED, refer to its datasheet or use a search engine.