| |||||||||||||||||||||||||||||||
Raspberry BarrelThoughts on Sensor mountingUpdate 30-10-2021 Currently I have an aluminium T frame which was used to mount various ultrasonic sensors. These were later removed to make way for the Pi camera. Now that many of the software components have been tested in isolation, I will soon be in a position to use several of the sensors at once. A more permanent solution is required, one that reduces the wiring spaghetti and combines many sensors. I’ve been thinking of a sensor 'barrel' in which I can mount the sensors and encapsulate the Pi. I want to make provision for:
There will be one forward-facing ultrasonic sensor. This is in addition to the Pi camera. There will be two 'side facing' sonars. All sonars will be maxbotics devices as my previous experiments showed these to be far better than the cheaper alternatives. The idea is to build it all into an 80mm pvc pipe: ![]() The wooden disk is attached to the robot base (bolted) and the adaptor screwed onto it. The 'barrel' or sensor tube will have all the sensors mounted inside (pointing out) as well as the Pi. The Pi may be mounted on the underside of the cap or near the bottom of the barrel for easy access. I may even try putting the compass on the cap (so it can we rotated to adjust) and possibly even the GPS. All the connections will be brought out by a single socket. Update 03-11-2021The mechanical parts for the barrel have arrived. The adaptor is 80mm high and the cap fits into the pipe, rather than over it as I expected (lockdown means there is no walking around Bunnings to see the parts so I had a few surprises). The barrel needs to be 120mm high in order to replace the existing tower and keep the sensors at the same height. Making the tower 140mm high gives a bit more headroom, I will try with the shorter barrel iinitially to see if I can fit everything into it. The pipe fits 40mm into the adaptor, so in order to create a 120mm barrel, I need to cut the pipe to be 80mm long. I aim to use a DB15 connector to make connections to the barrel. Maxbotix Sensor Beam WidthIn order to select the correct sensors for the side sonars, here are details of approximate beam widths taken from the data sheets. These are measured at 1200mm from the sensor and detecting a 2.54cm dowel.
The more directional the sensor, the less is its range. I was originally going to have 4 sonars, but I do not think an additional more directional sensor will provide much benefit in the forward facing direction. The EZ0 sensor (the widest beam sensor) seems to be the best choice for the side sonars as 3 sensors placed 60 degrees apart will give nearly a full 180 degree coverage. It may be, in practice that more directional sensors are useful, but initially, I feel 3 EZ0 sensors will give me best results. Incidentally, most of the time, the front sensor will be the only active one. Only when we need to navigate around an object will the side sonars be activated in such a way they do not interfere with each other. update 13-11-2021Raspberry Barrel ChangesI have spent some time working on the rasberry barrel. I've changed this so it no longer uses the pipe adaptor and instead this is a 120mm section of pipe. This gives more room to work in as its a bit tight in there. Pin configurations
// Maxbotix sonars
const uint8_t PINGEN_LEFT = 23; // sonar left RX (enable)
const uint8_t PINGPW_LEFT = 25; // sonar left PW (echo)
const uint8_t PINGEN_CENTRE = 27; // sonar centre RX (enable)
const uint8_t PINGPW_CENTRE = 29; // sonar centre (echo)
const uint8_t PINGEN_RIGHT = 31; // sonar right RX (enable)
const uint8_t PINGPW_RIGHT = 33; // sonar right PW (echo)
// 34 changed to 35!!
const uint8_t ENABLE_CAMERA = 35; // D35 enable camera WAS #34 CHANGED
const uint8_t ENABLE_TRAINING = 37; // D37 predict/training mode Training=1, Predict=0
const uint8_t IS_GRASS = 39; // D39 Read output from Pi to detrmine if grass or not
const uint8_t BARREL_SPARE = 41; // D41 Spare digital pin into Raspberry Barrel UNUSED
The Raspberry Pi GPIO pins have been setup programmatically to be:
More details on the new barrel design: ![]() November 2021 | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||