## catPooPee

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

Me fick and now baffled

I originally thought this would be reasonably simple but then slipped up and started rereading physics/ maths texts

Given the force of landing on the tray should give a spike in reading, then a second spike from the back legs you may be able to detect the start point BUT movement in the tray is going to wobble the data before you get the effect of leaving the tray...

Wonder if it’s best to group the values, throw out the extremes and average the middle (assuming some type of bell curve distribution) - I honestly do not know and it’s bugging me!

Arrgghhh - I now hate you and am going back to my multi-thread problems and locks on variables

So I think I’m down to suggesting glue the cat down to the tray to solve this and as for identifying the cat - would painting a barcode on the back be an acceptable option?

I get the feeling I may be in for a long night and get nowhere
Need Pi spray - these things are breeding in my house...

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

Grrr - you are building https://en.m.wikipedia.org/wiki/Weigh_in_motion

No idea if the work gone into these helps?
Need Pi spray - these things are breeding in my house...

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

@andyroo. Regarding wobbly data as the cats circle and scratch. I've noticed that when they're actually making a deposit they are almost motionless. I'm hoping that behavior may help with overall weight measurement of cat for health history. Also duration of the scratch-dance might also give insight into what's going on with their plumbing. Actually main hope for weight-instrumentation at this point is to document their deposits.

As for tat-barcoding their backs. We are a democracy here and the cats have the majority of votes locked up.

thx for link to weight-in-motion. will muse

For another alternate method of ID'ing the tray user. I'm going to try out one of these;
http://www.priority1design.com.au/shopf ... ucts_id=37
but the outfit that makes them are not hopeful I can get the range needed.
Last edited by monkeyfork on Mon Mar 18, 2019 9:21 pm, edited 1 time in total.

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

The pdf link is local to you I think but having watched lots of vet programs the scanners they use seem to be contact ones or at most a couple of cm away from the skin so I can understand the range issues.
I know you can get active dog collar chips BUT they are bulky.

Maybe a camera is too complex? Could you use a spectrum sensor like https://shop.pimoroni.com/products/as72 ... r-breakout to detect differences in the cats or their collars?

I’ll keep thinking as I’m waiting for a program to fail
Need Pi spray - these things are breeding in my house...

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

@andyroo, i fixed the pet-chip reader link (i think), thanks. I'll take a look at the spectrum sensor, interesting. Didn't know there were active dog collar, will take a look at that also. I've got my cat assistants wearing super cheap RFID tags which are short range but am more hopeful I can extend the range of those (I think they're at 13.56Mhz). Actually, the tinkering w/ pet-chip (134khz) chips is for some work I want to do with the T)rap N)euter R)elease programs here. I'm thinking of trying to make a remote trap so one trapper can handle lots of traps. Sure would be nice to detect a chipped cat before making the trap-ARM decision.

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

Just done the washing up and mid splash a thought struck me Feel free to shoot this down but I think you have too much data to see the information for the decimal points

Reading back you are more concerned by weight change not actual weight as the early warning sign so does the question become - is there a significant difference between the cat tray visits using either a weighted average or maximum value for the reading?

If cat A gives a reading of 300 then all you need to know is you may have an issue if cat A suddenly reports a reading of 280 or 320. It does not matter if cat B also reports 300 as standard if you crack the ID.

Getting to this value may be easier with a weighted ave based on time rather than trying to work out an accurate weight. You could always do that under controlled conditions i.e. with you present as a general health check.
Need Pi spray - these things are breeding in my house...

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

@andyroo, I want to be all things to all cat-people. This is more an exercise in low-cost retirement entertainment than narrowly focused goals. Somewhere back in this torturous thread i explained my lunacy and blamed it all on a beautiful russian lady so rational thought is right out, ha. For now just expanding the capabilities in whatever direction appears to provide helpful information (to maybe a vet or a shelter or a wealthy cat-lady) that doesn't cost me much in dev costs. As for which weight type is more useful for providing health indicator (absolute or short term relative)... I don't really have a clue. I'm hoping to recruit knowledgeable cat-people somewhere along the way that can tell me.

this afternoon I recruited my brother to look at the dataset tarball and comment. He said "why no audio on video clips?". Actually with a rpi cam and a usb-audio-input I guess I could put an audio track in the video clips. Thinking through that led to the obvious.... using audio to determine if the tray visit was for #1 (voooosh, drip, drip) or #2(PLOP, plop) or the dreaded #3 (mud-splattering-hippo-defecation).

btw... good luck on your software failing (wait, that doesn't sound quite right).

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

As for my bug - it’s takes about 256 loops (each taking 30 seconds or so) to show up (think it’s a byte overflow) and I forgot to stop the screen saver on my Mac so it dropped the SSH link half way through and I only noticed 10 minutes ago - long night for me!

I’ll continue on the rolling weighbridge thoughts for now then...

Maybe giving a treat to stop walking about would help if you could sort the hygiene issue out.
Need Pi spray - these things are breeding in my house...

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

@andyroo, have you ever tried "screen" program to keep a dropped ssh from killing a process? I usually use the nohup method but seems like younger folk like screen (assuming your test target is a linux machine, I don't know much else than linux).

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

Good point - got a bit wound up over the bug especially as I’ve been using tmux to monitor the output of the MQTT topics but I’m new to the keyboard controls and forgot to run it on the main program but the good news is that it was an overflow issue mixed in with global variables and two threads!

To be honest I do not sleep well at the mo so have enjoyed hunting odd weigh scale solutions - no use long term I think to anyone but you but who knows.

I have found http://www.openhivescale.org that has a few comments on load cells but I cannot find anything for a DIY scale for moving items. I can get lots of links for food manufacturing conveyors but they are not cheap to say the least (and I’m not going to say anything about the Australian chicken scales and how you use them)...

Best thing I can think of is to run a standard deviation on the numbers (possibly taking out the original / end bounces) and see if that kicks anything consistent out but my math is too rusty even with the help of https://www.mathsisfun.com/data/standard-deviation.html
Need Pi spray - these things are breeding in my house...

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

@andyroo,
" Because load cell are not supposed to be under continuous load "
never even thought about that. Mine's probably got 25% load on all the time with platform/litter-box/litter and increments up from there when the furball arrives. I've only used load-cells in wind tunnel models long long ago. In that application the strain-gauge only has strain during wind tunnel ops so that factor wasn't an issue. I'll have to read up more on that subject to see how much creep I might be inducing by having weight on the LCs all of the time.

might have some questions about MQTT someday. It was rec'd to me a while back for some robotic things I want to do. In case you have interest there, I've made a few house/yard bots that are based on CANBUS for message passing and are RPi/teensy centric. It was suggested to me that I should look into MQTT when the message blocks start getting bigger than what is comfortable for CANBUS.

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

I was watching a TV program based in Chester Zoo where they tracked the weight of some of the small monkeys (the young where 16grams) and this was done at the feeding station as they would take food and sit still to eat it.

Note sure if it’s relevant (as they did not show the weight scales) but thought I would let you know
Need Pi spray - these things are breeding in my house...

PhatFil
Posts: 1189
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

### Re: catPooPee

Andyroo has a good point, in the Cat-WC, as soon as the cat squats still it will start its mass reduction. While if you measure the mass of the food station (including food) you will have a much longer stable mass period to measure and average out for a good reading. And will provide the added metric of food consumed to your data set. the downside being the replication of the cat ID h/w at a second location.

for cat identifiction have you considered bluetooth ble beacons my limited understanding is they can be used to give a rough metric of proximity, so may be able to identify the closest cat when the food/toilet stations are entered.

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

PhatFil wrote:
Thu Mar 21, 2019 3:37 pm
... its mass reduction. ...
Love the description but I think its mass transference unless steam is produced so the load cells need to be under the tray (as I think they are).
Need Pi spray - these things are breeding in my house...

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

Andyroo, was planning on putting weight instrumentation on watering dish. I've got a professor friend that's had some luck using load cell at the feed trough for cat weighing as you and Phatfil mentioned. Might combine the two ideas for mass transference, ha.

Phatfil. I was NOT aware of the BLE beacons. I'm on it. I've just found some ID beacon tags (alibaba) that aren't hugely expensive so if there are existing solutions for triangulation I'd like that a lot. (please send links if you find any). I've done some work on my own using existing IR chipsets to make IR robot tracking beacons. I should look into adapting that to collars if I can figure a way to keep IR emitter on top for above viewing.

Just tried out gridPee prototype (litter tray with goal of using non absorbing re-useable litter AND grid containment of urine to facilitate urine samples). Discovered some very disturbing things about the ability of fiberglass screens to wick fluid SIDEWAYS that most definitely will lead to a redesign.

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

Tonight’s zoo program delved into the world of Galapagos Giant Tortoise and fighting over food (well more a long necked grab).

Slight movement of the animal while on the weigh scale was causing around 0.1 to 0.4Kg difference from an approx 60Kg animal.

You may find that cattle tags (esp the ones for the ears) may work. These could be fastened to the collar and may have enough range and the cattle normally go through a chute to be read. With current food regulations and consumer urge for ‘farm to fork’ traceability you may find the cost of these are cheaper than the more active beacons (unless the manufacturers want profit).
Need Pi spray - these things are breeding in my house...

PhatFil
Posts: 1189
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

### Re: catPooPee

sorry im only aware of the generalities of ble beacons. my limited understanding is that a beacon is placed in a static position and can then detect ble enabled devices like phones as they come within range, distance from the beacon being one of the data elements communicated. A tech designed for shops with the sort of customers who load shop apps onto their phones to target advertising within customer eyeline
So if you place the beacon on the cat then i think you would need at least 2 x client devices positioned in static known locations able to communicate with the beacon and retrieve the distance metric and forward that to the device/pi that can determine location from the 2 x beacon distances . hope this isn't a rabbit hole..

Andyroo
Posts: 2834
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

### Re: catPooPee

Main issue in trilateration is accuracy - you may not be able to tell which cat is closest to the tray compared to a NFC tag and reader at the back corner.

Have a look at https://locatify.com/blog/indoor-positi ... e-beacons/ for some interesting reading. I think their 1.5m is pretty good - the tests I was involved in got down to 2m on the dock and 4m in racks - no where good enough when you realise this was in test conditions AND is a plus or minus - in the racks it could have led to 100s of extra pallet moves.

For anyone reading - triangulation finds you to know the angle of the target from given points (the beacons) and impossible with omni-directional RF kit (I.e. just about every BLE on the market), triliteration is to find the location in x,y coordinates based on distance between the unknown point and two or more known point (normally on a flat plane) No I do not care what folk call it
Need Pi spray - these things are breeding in my house...

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

Thanks for great input guys, looks like i'm in for some due diligence to find real case studies with real data.

A lot of what I attempt is based on budget and path-of-least-resistance software. I just found this cli for looking for BLE beacons
using existing bluetooth utilities;
https://ukbaz.github.io/howto/beacon_scan_cmd_line.html

Since RPi3 and I believe the RPi-zero-W both have the BLE compatible hardware that may make BLE beacon tech float to top of stack for first testing. As long as there is a RSSI indicator and it can tell difference between 1m range and 3m range it will be good enough to ID which furball is in the litter-box/tray (no triangulation, just ranging). As for cat-behavior, it appears my two furry assistants have some concept of privacy (so, a range differential is maintained during tray visits) except for one instance in which furball-A was in the tray and furball-B was just outside the tray slapping furball-A... settling some score no doubt. Also, I have seen one instance on catPooPee video event clips that furball-B (a male) did a #2 and didn't do a great job of covering and hurriedly exited. Furball-A (a female) immediately jumped in the tray and finished the cover job, what a sport! Must remember to cover that corner case that will assuredly lead to a firmware-WTF.

I wasn't aware of the cattle tags will also put that in contention.

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

catPooPee update, I'm moving forward on cat-ID (which cat is in the litterbox/tray) and may even try to handle the general case of cat-tracking if BLE-beacons can be corralled and harnessed. It has been recently suggested to look at the BLE-beacons for this application and I've lightly searched on the subject. It looks promising however I get that feeling (as I have on previous attempts at using bluetooth for low data rate embedded messaging) that the BT-stack environment is a cauldron of batwings, swampwater and chicken-bones that is mostly a mass of bubbling funk. If __anyone__ has a good link to a _real_ working full end-to-end application (written in a simple rpi hosted language, preferably C or python) that has logistics part numbers and such I will pursue with vigor.

my goal is to use the BT engine on rpi-zero-W (that is already present in catPooPee project to do motion video of cat-box) to get RSSI indication of distance to cat-collar lashed BLE-beacon that might be available from ebay pre-prog'd to be a locate type beacon.

Progress continues on making second weighing platform complete with litterBox that uses re-usable litter and has special containment for urine with goal of facilitating urine dipstick or pipette samples. Progress is continuous but way slow because I'm ancient and must nap almost as much as my cat lab assistants.

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

(it is still 31mar2019 when I submit this post from Florida, so April fool mode reading is NOT allowed)

Researching anything about bluetooth remains (in my humble opinion) a frustrating experience. Way too much BS, way too little solid examples (for BLE beacon reception on rpi3 or rpi-zero-W). However, this https://raspberrypiandstuff.wordpress.c ... th-beacon/ site turns rpi (with integral BT) into what is supposed to be a BLE-like-beacon. I am able to see beacon packets on android phone using the beacon scanner app linked in the above how2. It appears that the how2 method sets up a 1pps beacon and the setup give a real world indication of the quality of the technology as it exists for determining range (answer... dogsh_t AWFUL, wildly varying). Although not acceptable for real ranging or navigation it could be acceptable for proximity declaration IF I can get the RSSI upon packet receipt from the rpi BT stack (unknown at this time).

How close the simulated BLE-beacon made by the how2 might simulate an off the shelf low cost keychain beacon like this one: https://www.aliexpress.com/item/NRF518 ... src=aw.ds would be of GREAT interest to me if anyone knows (cats everywhere will thank you).

PhatFil
Posts: 1189
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

### Re: catPooPee

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

minor breakthru in BLE-beacon feasibility for cat identification for determining what cat is in the litter-box(tray). With one rpi3 configured as BLE-beacon (from how2 linked in previous post) I can see the beacon packet on rpi across room with hci-dump as shown here;
> HCI Event: LE Meta Event (0x3e) plen 33
Flags: 0x06
Complete service classes: 0xfeaa
Unknown type 0x16 with 12 bytes data
So, I've got the unique identifier and an indication of RSSI. From my Android BLE-beacon sniffer I see that the advertised transmit power of the BLE-beacon is -41dbm. I've seen RSSI indications as low as -91dbm on the Android scanner as I move away from the BLE-beacon. So... wild guessing here.. looks like enough dynamic range to have some hope of determining who the "close-cat" is likely to be if each cat is instrumented w/ a beacon. I think I've seen enough BLE-beacon goodness now to order some cheapie BLE-beacons, affix the beacons to cat collars and have an all hands meeting to discuss the importance of privacy in the loo/wc/outhouse (to insure range determination deconfliction).
Last edited by monkeyfork on Mon Apr 01, 2019 11:35 pm, edited 1 time in total.

monkeyfork
Posts: 58
Joined: Tue Oct 29, 2013 10:14 am
Location: orlando

### Re: catPooPee

Good stuff PhatFil, as you see from last post I'm making progress. I've got enough rpiZeroW's and rpi3 to put around the house to at least eval cat tracking once I get some beacons (now on order) for my furry assistants. I might take a shot at adding to the rpi knowledge base about why the RSSI numbers are so awful in a static situation (with fixed range RSSI jumps wildly). I've got some Ultra-Wideband ranging gear here that I might be able to use as a truth standard to compare the BLE-beacon ranges against. I'll also try to eliminate the very probable interaction between wifi and BT. Thanks for the links.
Last edited by monkeyfork on Mon Apr 01, 2019 11:31 pm, edited 1 time in total.

PhatFil
Posts: 1189
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

### Re: catPooPee

my interest in ble beacons is as something i could possibly use, so not even novice level, but one document i read ( and of course i cant find it now..) suggested for diy use calibrating each device by monitoring its rssi at a known distance/s ? 1m? and perhaps plotting other known distances building up a lookup table? the expected commercial use of advert pushing just needs the device within range..

If thats what you were attempting with the tests detailed above, i guess my usefulness has come to an end..