Record Changes in Height of Book Stack - Best Sensor?

There is a type of plate rack often used at serving counters which consists of a vertical tube with a sprung platform in it. The spring free length is such that the platform is exactly level with the top of the tube when it is unloaded, and the spring rate is chosen so that the weight of a plate compresses it by exactly the height of a plate. This means that no matter how many plates it's holding, the top plate is just at the top of the tube.

You could do something similar for your book stand. As well as showing the curious some interesting physics, it means that you could sense the number of books from the bottom of the pile rather than the top, which you could do using a string/pot or whatever other type of distance sensor you like. Of course you could have read from the bottom of the stack anyway using a force sensitive resistor to measure the weight of the pile, and that would be my second choice, but that's far less fun.

Ah, that suggests an approach.

Rather than having to fish around for a set of springs that are just right, use a stepper? motor and screwthread drive
to raise and lower the platform so that the top of the stack is level with some dual light-beam detector. By counting the
steps needed each time is changes you can count the number of books.

By using a screwthread drive the motor can be powered down between uses. When both beams are blocked or neither
are blocked (for more than a few seconds), you power up motor and step till just the bottom beam is blocked, simple!

An alternative with less heavyweight engineering is to use one light beam detector than is motor driven. To measure
the pile of books it just goes to the bottom and scans upwards till the beam gets through - even a simple DC motor can be
used if the speed is nice and constant - just time the motor travel!

If you go the IR route, you really only need two interrupters. You would just sense the direction of movement into and out of the box. Increment and decrement your count based on that.

As you described it, there is only one entry and exit point to the box.

My initial thought was more along the lines of Peter's and it sounds like the most fun and interesting, but probably the most complicated to build. If you did go that route, you could add a flag to the pedestal that gives a visual indication of the number of books as well.

Thanks for the ideas. I'm really looking for something that fairly inexpensive, pretty accurate and not too challenging. As I mentioned I need to track the height of the book stack as it changes in a confined space - a box. With that said, it sounds like the two IR stips (transmitter and receiver) might be the way the go as posted by astrofrostbyte. Can some recommend a manufacturer or perhaps provide a link for the stips? Would they work with an Arduino board? If at all possible can someone also suggest a link where I might find some sample code associated with using the IR stips? I really appreciate everyone's input and advice.

That would need a sender and receiver per book, wouldn't it? How many books do you plan to support?

If you don't fancy the suspended stack approach, I'd have thought weighing the pile of books would give you a simpler solution with lower part count. Force sensitive resistors don't cost much.

tdirodis:
The only stipulation is that I cannot use any sort of scale or pressure system to determine the change.

I believe this is why, Peter.

I offer 3 plans;-

Plan A.

Digital Calliper and Arduino, measure Height of Book Stack directly. modify Calliper as book holder

Plan B.

Ultrasonic distance sensor and Arduino, measure Height of Book Stack indirectly by leftover Height.

Plan C.

RFID and Arduino, get which books in the shelf, u could get height.

tdirodis:
Thanks for the ideas. I'm really looking for something that fairly inexpensive, pretty accurate and not too challenging. As I mentioned I need to track the height of the book stack as it changes in a confined space - a box. With that said, it sounds like the two IR stips (transmitter and receiver) might be the way the go as posted by astrofrostbyte. Can some recommend a manufacturer or perhaps provide a link for the stips? Would they work with an Arduino board? If at all possible can someone also suggest a link where I might find some sample code associated with using the IR stips? I really appreciate everyone's input and advice.

You still haven't given us more detailed requirements about your system, like dimensions of book, box ,powersupply, userInterface, etc...

I'm afraid you can not buy IR ledstrips readymade, you also have certain requirements for spacing etc..
You can make the strips fairly easy when you use 5mm led's. If you buy IRled's make sure to choose one's with small emmision angle.

For reliability I would not go for the book in/out detection with 2 led's because you have to pay allot of attention to false triggers (people hands etc.
For reliablity i was also thinking of modulation, just to filter out ambient influences. Modulation would be simply switch led ON and off a few times and, checking if photodiode follows.
Do not underestimate receiving the IR signal with the photodiode. Adding an opamp and some filtering might be needed.

Idea was to use a 1->8 or 1->16 Digital Mux for your led's , and 8->1 or 16->1 analogMux for photodiodes depending how many led's(books-levels) you need/have.
I think this can fit on a Arduino nano/mini, but still unclear what your Userinterface is.

Retroplayer:

tdirodis:
The only stipulation is that I cannot use any sort of scale or pressure system to determine the change.

I believe this is why, Peter.

Good point, I hadn't spotted that.

In order to know what other type of sensing might work, we need to know more about the characteristics of the books (size, thickness, number) and any constraints in the structure that holds them - does the holder already exist?

The box was custom built so that the books are stacked on one another so all sides are aligned. There is a 2" slit in front of the box which allows you to see the spine of the book. In other words you can see that there are still books in the box without looking into it from the top. As I mentioned in my original post "on the left and right inner sides of the box there is a 2 inch gap with vertical slats running the height of the box so as to keep the books neatly stacked on one another." It's in the gaps that I'd like to place the (still trying to determine the best) sensor. I'm intrigued by astrofrostbyte's idea:

Idea was to use a 1->8 or 1->16 Digital Mux for your led's , and 8->1 or 16->1 analogMux for photodiodes depending how many led's(books-levels) you need/have.
I think this can fit on a Arduino nano/mini, but still unclear what your Userinterface is.

and I'm hoping it's not to complicated? In terms of the interface I'm thinking an Arduino boad powered by a USB chord to which the sesnor(s) is/are attached (if that makes sense?) I should have also mentioned that I cannot use a ultrasound sensor as the book box gets moved to different areas. The books are all the same with the following dimensions: Front cover from left to right = 7.5", Front cover from top to bottom = 9", Front cover to back cover = 3/4". The box can accomodate approximately 15 books.

The Circuit is not to difficult but still needs attention.
First think of your circuit to measure a 1 book high stack with one IRled and one photodiode, then look at extending it using a 'Analog 16channel Multiplexer' like the 74HCT4067 and others.

BlockDiagram would be a bit like this. ( just was playing arround with schematics drawing tool on http://www.digikey.com/schemeit# )

I think I'm just about convinced that this is the way to go on this project. Astrofrostbye, would you mind providing a recommended parts list? I'd like to get started ASAP. Thanks for everyone's input to date. I'm sure I'll have more questions to follow.

If the inside of the box is well illuminated then you only need detectors that the book spines would block or not. Maybe drill holes through the vertical slats and put the detectors in, but if the books are thin that would be a LOT of detectors needing to be wired. Good news is a bag of detectors might run 5 cents each.

I was looking at fiber optic cable, to feed the light from many to 1 phototransistor but wow, the cable I see costs more than detectors and wire!

You could try ultrasonic sensing from above the box. Check them on eBay, they're cheap.
http://www.ebay.com/itm/HC-SR04-Ultrasound-Wave-Detector-Range-Ultrasonic-Sensor-Distance-Module-/200896270284?pt=LH_DefaultDomain_0&hash=item2ec659cfcc
This looks the same as the ones I got from LC Tech. It's supposed to be good to 2mm but I didn't get that in quick testing. Getting it right should be a little problematic.

There is a 2" slit in front of the box which allows you to see the spine of the book. In other words you can see that there are still books in the box without looking into it from the top.

That presents single detector possibilities but they would have to be positioned in front of the box.

Astrofrostbye, would you mind providing a recommended parts list?

Well since it's a school project this is probably a good moment to learn about the few components you're going to need. Just take a day to read up on PhotoDiode/Transistor, analog multiplexers, etc.

I would recommend Farnell for a bit of components selection, for example if you go to optoelectric section you can select IR emitters, and select the key specs your looking for like 'emision angle','case' and 'sort on price' you'll get a good selection.
Then buy a few components and start testing and prove to yourself that this is a good design approach.

maybe....
Since your bookthickness is defined, and relatively large, maybe it could be as simple as using a bunch of lever-switches ?

For robustness just mount them behind a steel strip with holes in where the little wheel sticks out.

astrofrostbyte:
Since your bookthickness is defined, and relatively large, maybe it could be as simple as using a bunch of lever-switches ?

For robustness just mount them behind a steel strip with holes in where the little wheel sticks out.

Do micro-switches cost less than phototransistors? Ceiling lights or a led in the box is enough illumination for those if not covered by a book.

But there is another way not prohibited, you may like.

The only stipulation is that I cannot use any sort of scale or pressure system to determine the change.

If all the books have a strip of aluminum foil taped over the spine, they would have capacitance with other strips of foil close in the box. To check you quick charge a foil strip in the box through a resistor for a millisec or 5 and then count microseconds (small resistor) until the charge bleeds to digital LOW.
You can multiplex pins. One goes HIGH, one goes LOW, the intersection has current flow. There, it rhymes even. You save on resistors multiplexing, they only need to be on the pins for rows or columns. Multiplex also works for phototransistors.

Thanks for the additional ideas. What do you guys think of maybe utilzing this type sensor: BittyBot 3-Way Object Sensor - Solarbotics Ltd. in this application?

Looks cool, but my eye caught the Price $30,- , for that money you can buy 16x (IRled's+photodiode) and 2x Ana.multiplexers.
Remember that with the arduino you can do a bit of modulation also.

pseudocode:
for ( i = 0 to 200 )
{ Switch IR led ON
  delayus(  )
  varON += Read AnalogIn from PhotoDiode
  Switch IR Led OFF
  delayus(  )
  VarOFF += Read AnalogIn from PhotoDiode
}
val = (ValOn-ValOFF)

You need to test this because its hard to predict how strong your photodiode signal will be, and influence of Day/artifi. light.

tdirodis:
Thanks for the additional ideas. What do you guys think of maybe utilzing this type sensor: https://solarbotics.com/product/40253/ in this application?

I don't think you will get range from those sensors good to know 1 book from 2 or 3. Also detection range is short,

a 3-direction object sensor, with a 4~6" (10.16-15.24cm) range.

I've got to admit that this is much more overwhelming than I had orignally thought. I'm far from an electronics whiz. I like the idea that astrofrostbyte recommended but even after reading up PhotoDiode/Transistor, analog multiplexers, etc. I don't even know where to begin in terms of purchasing the items for this project. It be nice if I could keep the cost to less than $100. I did look at the Farnell website but I'm not sure what would work with an Arduino board or even how I'd begin to hook it all up. Any advice would really be appreciated.

For a mux, this is cheapest: https://www.sparkfun.com/products/9056 at $5, but this is probably easiest (well not really, it's really the same basic thing but with 3 of them): Mux Shield II - DEV-11723 - SparkFun Electronics
That one for $5 will give you 16 inputs, should be enough, right?

You can set up a photo-diode to work with a digital pin so you don't have to worry about an analog mux at all. But, maybe kill two birds with one stone and just get these: https://www.sparkfun.com/products/9454

These are IR reflectance sensors. You would install them just on one side and they will reflect off a close object and you can detect the book. These will need to be fairly close though and you would get better results if you were able to put white (tape) on the spines of the book. But at $3 a pop, they are worth investigating. They are just plug and play. I forget how many books you said were total. 16 books would be $48 in sensors, but you don't need the mux.

Did you need a display for the count?