Without a clear picture of what your robot looks like or the course it must follow, I can only offer limited help.

There are several options available to detect the ramp. It if it were up to me, I would use a simple mercury tilt switch. A little more advanced, you can also use an accelerometer to detect acceleration of the robot and provide angle measurements for you to measure the slope of the ramp. A flex sensor properly placed at the front of your robot could bend to indicate a ramp is ahead. Or even the line detection sensors could be placed such that the ramp could trip them.

There a few more details that would be helpful. -what is the approximate size of the ramp? -What is the purpose of sensing the ramp(is it to increase power going up the ramp to maintain a speed)? -Are you able to add additional sensors or can you only use the infrared? -When do you want to sense the ramp. when you are a 1' away or when the robot starts to hit the incline?

These basic points will play a big part in the recommendation of appropriate sensors for the application.

alternately, if you are OK with sensing the ramp once you're ON the ramp, you could use a gyroscope to detect whether the robot is tilted. That would elliminate some of the problems with using an accelerometer (the biggest problem being: how do you use an accelerometer to distinguish between acceleration and the incline?)

alternately, if you are OK with sensing the ramp once you're ON the ramp, you could use a gyroscope to detect whether the robot is tilted. That would elliminate some of the problems with using an accelerometer (the biggest problem being: how do you use an accelerometer to distinguish between acceleration and the incline?)

MIKE

Position the accelerometer such that one of the axis' is facing along the axis represented by up and downward motion (most commonly associated as a "z-axis"), instead of the xy planar axis that may be usually associated in correspondence to the floor. Acceleration along the x and y axis should not have any effect on the z-axis. Only in the circumstance that the robot is suddenly forced slightly upward by hitting the base of the ramp should the z-axis measure any change in G's.

Another possible solution that involves tilt switches , get the smallest ones you can find and arrange as many as you can at slightly different angles , as your robot tilts the relevant switches are activated , the main difficulty with this is the accuracy is totally dependent of the quality of workmanship and the amount of switches used .

I really don't no if it would work , its just an idea I thought to put in as I read your question .