Omron G5V-2 relay NO pins not working
The relay connections in the book are wrong.  The Omron datasheet for that relay shows that the connections fro the contacts are Common, NC, NO, where the book appears to use NC, common, NO.