When did Pinocchio first realise he was made of wood?

When his hand caught fire whilst he was pleasuring himeself...