Smart pig