Here is a sneak-peek of the Raspberry Pi to Arduino shield based thermostat project I have worked on for the upcoming book.
The prototype you see below is part of a project in one of the chapters:
This uses a relay shield attached to the Raspberry Pi to Arduino shield. The relays are then switched on and off based upon a change in temperature. Connected to the relay shield is a wall powered electric fan.
Here is a quick sneak-peak of an experiment I conducted when testing out some of the hardware.
The video below shows a combination of a Raspberry Pi, the Cooking Hacks shield, an Arduino motor-shield a small DC motor and a circuit consisting of a resistor and photo-resistor.
The software in the background is processing the feedback from the photo-resistor and deciding when to turn the motor on and off, and in which direction. This software also generates the necessary PWM for the motor.
In the video I cover the photo-resistor to turn the motor clockwise and then uncover it to turn it counter-clockwise.
P.S Thanks to Andy C on the Cooking Hacks forum for pointing me in the direction of using C threads for PWM.