Somertons, pllc
Attorneys at law
1025 Connecticut Avenue, N.W.
Suite 1000
Washington, D.C. 20036
Tel: 202.459.4651
Fax: 202.478.2980
www.somertons.com

EXHIBIT 5.1
July 18, 2025

The Board of Directors
Tecogen Inc.
76 Treble Cove Road
Building 1
North Billerica, Massachusetts 01862

Re:    Tecogen Inc.
Securities Registered under Registration Statement on Form S-1

Ladies and Gentlemen:

We have acted as special securities counsel to Tecogen Inc., a Delaware corporation (“Company”), in connection with (i) the Registration Statement on Form S-1 under the Securities Act of 1933, as amended (“Securities Act”), filed by the Company with the Securities and Exchange Commission (“SEC”) on July 15, 2025, ss amended on July 16, 2025 (“Initial Registration Statement”), and (ii) a second Registration Statement on Form S-1 filed pursuant to Rule 462(b) under the Securities Act (“462(b) Registration Statement,” and together with the Initial Registration Statement, the “Registration Statement”). This opinion is being furnished to you in connection with your filing of the 462(b) Registration Statement relating to the registration by the Company of up to 918,333 additional shares (“Shares”) of the Company’s common stock, $.001 par value per share (“common stock”), including 85,000 shares of common stock purchasable by the underwriters upon their exercise of an over-allotment option granted to the underwriters by the Company. The Shares are being offered and sold pursuant to an underwriting agreement (in substantially the form filed as an Exhibit 1.1 to the Initial Registration Statement) to be entered into by and between the Company and Roth Capital Partners, LLC, as sole underwriter and manager of the offering (“Underwriting Agreement”).

This opinion is being furnished in connection with the requirements of Item 601(b)(5) of Regulation S-K under the Securities Act, and no opinion is expressed herein as to any matter pertaining to the contents of the Registration Statement or the 462(b) Registration Statement, other than as expressly stated herein with respect to the issue of the Shares.

We have examined originals of copies of the Company’s Amended and Restated Certificate of Incorporation, Amended and Restated Bylaws, the Registration Statement, the preliminary prospectus included therein (“Prospectus”), the 462(b) Registration Statement, the form of Underwriting Agreement, minutes of various meetings and consents of the Board of Directors of the Company, originals or copies of all such records of the Company, agreements, certificates of public officials, certificates of officers and representatives of the Company and others, and such other documents, certificates, records, authorizations, proceedings, statutes and judicial decisions as we have deemed necessary to form the basis of the opinions expressed herein. As to various questions of fact material to our opinion, we have relied upon statements and certificates of officers and representatives of the Company and others.

In such examination, we have assumed the genuineness and authenticity of all signatures on original documents; the authenticity of all documents submitted to us as originals; the conformity to originals of all documents submitted to us as copies or specimens; the authenticity of the originals of such documents, agreements and instruments submitted to us as copies or specimens; the conformity of the text of each documents filed with the SEC through the SEC’s Electronic Data Gathering, Analysis and Retrieval System to the printed document reviewed by us; the accuracy, completeness and authenticity of certificates of public officials; the due authorization, execution and delivery of all documents where authorization, execution and delivery are prerequisites to the effectiveness of such documents; that the Initial Registration Statement and the 462(b) Registration Statement have become effective under the Securities Act, the Prospectus, the final prospectus, and any and all free-writing prospectus(es) related to the offer and sale of the Shares have been delivered and


Somertons, pllc
The Board of Directors
Tecogen Inc.
July 18, 2025
Page | 2

filed as required by such laws; that the issuance and sale of the Shares does not violate any applicable law, are in conformity with the Company’s then operative charter and bylaws, does not result in a default under or breach of any agreement or instrument binding upon the Company and comply with any applicable requirement or restriction imposed by any court or governmental body having jurisdiction over the Company or its properties or assets;  the Prospectus included in the Registration Statement contains or incorporates by reference therein all information and disclosures required by applicable SEC rules and forms; the Underwriting Agreement with respect to the Shares offered will have been duly authorized and validly executed and delivered by the Company and the other parties thereto; and the Shares to be sold to the underwriters by the Company will be sold at a price established by the board of directors of the Company or a duly authorized committee thereof.

In connection with the preparation of this opinion, we have reviewed such questions of law as we deemed necessary. We do not herein give any opinion with respect to the laws of any jurisdiction other than the laws of the District of Columbia, the general laws of the United States of America, Federal securities laws and Delaware corporations law (including the statutory provisions, all applicable provisions of the Delaware constitution and reported judicial decisions interpreting the foregoing), all as in effect on the date of this opinion. We are not rendering any opinion as to compliance with any Federal or state law, rule or regulation relating to securities, including but not limited to, state “blue sky” laws, or to the sale or issuance thereof. Our opinion expressed below is subject to bankruptcy, insolvency, fraudulent transfer, reorganization, moratorium and other similar laws of general application affecting the rights and remedies of creditors and to general principles of equity.

Based upon the foregoing, we are of the opinion that the Shares have been duly authorized by the Company and, when issued and delivered by the Company against payment therefor in accordance with the terms of and in the manner contemplated by the Underwriting Agreement, the Registration Statement, and Prospectus, will be validly issued, fully paid and nonassessable.

We hereby consent to the inclusion of this opinion as Exhibit 5.1 to the 462(b) Registration Statement and to the references in the Initial Registration Statement, Prospectus, and in the final prospectus for the offering to this firm as attorneys who have passed upon legal matters in connection with the offering of the securities described therein under the caption “Legal Matters.” In giving such consent, we do not believe that we are “experts” within the meaning of such term as used in the Securities Act or the rules and regulations of the SEC issued thereunder with respect to any part of the 462(b) Registration Statement, including this opinion as an exhibit or otherwise.

This opinion is expressed as of the date hereof unless otherwise expressly stated, and we disclaim any undertaking to advise you of any subsequent changes in the facts stated or assumed herein or of any subsequent changes in applicable laws.

Very truly yours,


/s/Somertons, PLLC
Somertons, pllc