Date: 202007
Local time of day: 1201-1800
Location: ZZZ.Airport, US
Flight conditions: VMC
Weather elements / visibility: Turbulence; 10
Light: Daylight
Aircraft: Small Aircraft; High Wing; 1 Eng; Retractable Gear
Operator: Personal
Operating under: Part 91
Flight plan: VFR
Mission: Personal
Flight phase: Climb
Airspace: Class E ZZZ; Special Use XXXX
ATC / advisory: TRACON ZZZ
Reporter organization: Personal
Reporter function: Single Pilot; Pilot Flying
Reporter qualification: Flight Crew Private
Human factors: Communication Breakdown; Confusion
Anomaly: Aircraft Equipment Problem Less Severe; Airspace Violation All Types; Deviation - Altitude Excursion From Assigned Altitude; Deviation / Discrepancy - Procedural Clearance; Deviation / Discrepancy - Procedural Published Material / Policy
Detector: Person Flight Crew
When detected: In-flight
Result: Flight Crew Exited Penetrated Airspace
Contributing factors: Aircraft; Human Factors; Environment - Non Weather Related
Primary problem: Human Factors

Narrative: While on climbout from ZZZ; I activated the autopilot at about 2.2 nm  from ZZZ by pushing the reverse course and uploading it to the GNS-530.  The autopilot engaged and then turned the plane from the runway heading of 260 to a heading of 217 to intercept the course at heading of 241. When the autopilot turned to course 241 I was at about 3;000 feet MSL and was entering R-XXXX.  About 30 seconds later I realized my that I was in R-XXXX and took action to climbout of R-XXXX to the min altitude of 3;999 feel MSL.  I was able to climb above 4;000 feet in about 30 seconds and climbed out the R-2XXXX.  During this time I was still on ZZZ UNICOM.  I was not able to communicate with ZZZ TRACON well past R-XXXX.  I do not know if R-XXXX was active when I flew through it...and I did not ask ATC when I received flight following to ZZZ1 a few minutes later.This violation of airspace was caused by two actions:  1- On my flight out; I used a feature of Foreflight to plot out the procedure to enter the traffic pattern on Runway XX.  When Foreflight plotted this course out it went around R-XXXX.  When I reversed the course to take me back to ZZZ1; Foreflight plotted me directly through R-XXXX.  My failure to fully understand how the software works and making an assumption that it would take me back on the same course around R-XXXX was an error in my judgment.2- My lack of situational awareness played a large part in this.  During the climbout the air was turbulent and I was getting bumped around a bit.  This in combination with trying to change the radio to ZZZ TRACON; I lost track of where I was at and made assumptions about where I was flying.  I fell into the trap of trusting the autopilot but not verifying where it was going.My lessons learned for this flight are as follows:1- When plotting a return course; do not attempt to do it in the air; take 5 minutes and do it on the ground verifying that the course is what I expect and does not take me where I am not supposed to be.  In other words; slow down for I was trying to get back to the airport at a certain time to meet someone...I should have kept them waiting 5 minutes as I did a proper flight plan home.2- I have not been flying a lot in the last 6 month (COVID-19 has seen to that) and I was feeling a little behind the plane on this flight.  I should have brought a CFI or a safety pilot with me to check me and help me regain my proficiency.




Synopsis: Pilot reported entering restricted airspace and referenced lack of flying as a contributing factor.