Can I access public:// from inside a module?
You're looking for the file_create_url() function:


  Creates a web-accessible URL for a stream to an external or local file.


e.g.

$data['avatar'] = file_create_url($profile-&gt;field_picture['und'][0]['uri']);