Exhibit 23.1

Consent of Independent Registered Public Accounting Firm

Energy Recovery, Inc.

San Leandro, California

We hereby consent to the incorporation by reference in the Registration Statement on Form S-8 of our reports dated March 13, 2012, relating to the consolidated financial statements and financial statement schedule, and the effectiveness of Energy Recovery, Inc.’s internal control over financial reporting, appearing in the Company’s Form 10-K for the year ended December 31, 2011.

/S/ BDO USA, LLP

San Jose, California

March 13, 2012