As the 3 Sharp IR analog sensors in my robot design consume plenty of power, I’ve created an interconnect module that switches the load on and off by way of a TI nMOS FET. The microcontroller will periodically switch on the load, take a reading of the three sensors via ADC, and then switch the load off again. This process is controlled by timer-based interrupt, storing the distance reading in a global variable.
Monthly Archives: March 2015
Preparing the Sharp 0A41SK for testing. Soldered a 10uF bypass cap, as per the data sheet and others. Don’t have any JST PH connectors, so the leads have also been soldered. Covered the exposed bits with polyamide tape prior to soldering the cap. Hot glue will be used for strain relieve in protecting the solder joints.
The comparator circuit presented in the course detected flex in the sensor for only one direction, as this is a single rail circuit. This presents a challenge, as my robot platform uses a single long whisker straight out the front to detect collision. An obstacle could strike the end of the sensor and bend it in either direction. Thus it is crucial that the micro controller be able to read a flex in the sensor in either direction.
Having measured the voltage differential across the Wheatstone bridge flex sensor circuit, I noticed that a negative voltage when the sensor was flexed in the direction opposite from what the datasheet advises. It stood to reason that this change in voltage might be detectable.
After posting my circuit and question on the discussion board, Thomas_91 was kind enough to supply the following voltage window circuit. It is a dual comparator circuit that detects an upper and lower reference, and gives a HIGH when within the window of the reference and LOW when outside the reference, or the inverse. In my case, I want to measure when the sensor is at rest, and provide a HIGH signal when outside the window. This solves my design problem of wanting to detect a flex in either direction.
Having installed LTSpice but never really used it in solving a problem, I recreated Thomas_91’s circuit, and adapted it for my purposes. Verifying the window and threshold behaviours in simulation, I breadboarded the circuit and included trimpots to adjust the upper ceiling of the voltage reference. The flex sensor is measured with a trimpot for adjustment to its balance.
I created a small program in Arduino to read the output of the dual comparator on a digital pin. After fine tuning the trimpots, I was able to get a very satisfactory sensitivity range.
The Sensor Rig
After reading the many comments about how this particular flex sensor can break easily, I followed the instructor’s example and mounted my sensor on a tie wrap. Smooth sided tape was used to fashion a sheath that allows the sensor and tie wrap to bend together without bunching up.