The rights to How To Be Good are worth £2m and will go towards building a national educational centre for children with autism.
The centre will cost £11.5m to build in total, of which £5m has been provided by Futurebuilders.
The Treehouse Trust, which is a London school designed to cater for the specific needs of children with autism, was set up by a group of parents, including Hornby, in 1997. Hornby's 12-year-old son Danny is autistic.
Hornby said: "It seems obvious to me that some of my money should go elsewhere - to a charity that works harder than I do, and which can use the money better than I can. I don't feel this is heroic, just logical."