Sigh. Glad to hear you're going for a hardwired sub-panel.
However, what you need at this point is something called a "Load Analysis". This is where a cognoscenti (typically, an licensed electrician) takes a look at the main (which, in your case, is 40A for the panel), the other loads (probably a garage outlet and/or a garage door opener), and comes up with a figure that says how many amps you can draw without blowing the main.
I'm not an electrician; but I'd guess that if you have a 40A breaker upstream, putting a 40A circuit downstream may not be such a great idea. But don't listen to me.. or for that matter, other maniacs on the interwebs. Find a licensed electrician, not some, friend-of-a-friend-of-a-friend who'll be over the horizon faster than Jack Splat if something catches afire.
I do have a comment, though: the National Electric Code says that if one has a circuit fused at Yea then, if one has a steady, heavy load, the most that steady, heavy load can draw is 80% of Yea. That's why if one has a 15A circuit for some 120 VAC socket somewhere, the max steady load is 12A, 80% of 15A.
So, in an ideal world, if you wanted to charge your Tesla at its maximum current draw of 48A @ 240 VAC, you'd need a 60A breaker, 60A wire, and a hardwired wall connector from somebody (Tesla or otherwise) that can do 48A steady load. (80% of 60A = 48A.)
Now, that also means that
if you actually
could do a 40A breaker to a Tesla Wall Connector or some such, the most current that would be allowable would be 32A. (You'd still have to have 40A-rated wire, though.)
If ye electrician says that a 30A breaker is OK, then the Wall Connector would be provisioned for that - and you'd have 24A @ 240 VAC charging.
Now, you've got a Model Y. Last I heard, those run at 280 W-hr/mile. Suppose that you want to put 200 miles on the car. Well, let's look at the charging rates:
- 240V @ 48A = 11.52 kW. 11.52 kW/(.280 kW-hr/mile) = 41 miles/hour. 200 miles/(41 miles/hour) = 4.86 hours.
- 240V @ 32A = 7.68 kW. 7.68 kW/(0.28 kW-hr/mile) = 27.4 miles/hour. 200 miles/(27.4 miles/hour) = 7.29 hours.
- 240V @ 24A = 5.76 kW. 5.76 kW/(0.28 kW-hr/mile) = 20.57 miles/hour. 200 miles/(20.7 miles/hour) = 9.7 hours.
Point is: First, ya gotta sleep sometime. So, all of these times are when you're at home, eating, sleeping, and all that. So, it's all pretty much classified as, "Overnight". Except maybe the last one.
Note that your MY probably has a 333 mile range, when charged to 100%, which you'll likely rarely do: More likely, you'll be at 80%, which maximizes the lifetime of the battery, and that's about 266 miles. I usually charge the cars over here when they get down to a little over 100 miles, and that shortens up the charging time. But it's good to have the numbers in front of one, which is why I did those, above.
A couple more comments about cost. Note that with a 40A breaker the
most you'll be doing is 32A. As it happens, the Tesla Mobile Connector (TMC), available over at Tesla, can be rigged with the right kind of plug and all to run on a 40A circuit; so, in theory, one could run down to Home Depot or something, get an appropriate socket, pay something nominal for that, pay $250 or so for the TMC, and be running for cheaps.
I'm here to warn you against that. First, the Home Depot specials are not industrial gauge, and the forum here has a number of pictures of consumer-grade connectors that have gone all melty and fire hazardy. An industrial grade socket costs around $150 or so.
Worse, if you're putting one of those sockets in your garage, modern electrical code calls for a GFCI breaker. Those are upwards of $200. So, between buying the TMC, a GFCI breaker, and an industrial grade socket, never mind all the labor and such, you'll be over $500.
On the other hand, A Tesla Wall Connector can be found at Tesla for $450 and other companys' products for similar. They all come with a GFCI built in, so all one needs is the wire (which both solutions use) and a straight breaker, which is cheaper by far than the GFCI type.
Depending upon the State you live in, there's sometimes incentives to have a Wall Connector that reports back to some Mothership or other to let them know how much energy you're using to power your car; in which case, a discount may come your way. At least in NJ, if one is doing that, then the Mothership, whoever they are, posts a list of Acceptable Wall Connectors that can do that thing. So, that may drive the decision of Which Wall Connector to get.
Finally, and I want to emphasize this: Everything in the NEC and local codes is about Taking Care of The Heat. Run current through a wire; all wires have resistance; power in a wire (just like in an electric stove burner) goes as current*current*resistance. Unlike an electric stove burner where one
wants the element to glow dull red at times, the NEC is all about keeping the temperatures of the wires, sockets, breaker elements, and such like far, far away from anything that might cause such an element to get warm enough to degrade the insulation around that element. We're talking fire, life, and death here. So, don't take any wooden nickels and stick to licensed electricians, unless >you've< got that expertise. If you do, my apologies.
Have fun!