Rob|Fan* is a fan that follows a subject around a room, always pointing its breeze straight at them: a robotic fan.
An array of sensors lies along one wall. Each of their positions with
respect to the fan is known beforehand and stored in the array
yDist[NUM_SENSORS]
in ./sketch/sketch.ino/sketch.ino.ino
(I deeply apologize for this naming convention).
loop()
checks each sensor in turn to see if a valid distance is being returned,
which means that someone is standing in front of the sensor.
We reference the specific sensor's position from the fan
in order to come up with a y-coordinate,
and we use the distance received from the sensor as the x-coordinate.
Then we use math:
// SUCCINCT
int angleRotate(int x, int y)
{
return (int) atan((double) x / y);
}
This gives the angle from the /wall intersecting Fan & parallel to sensor lines/ to rotate the servo towards.
While some of these aren't the exact ones I used they should be close enough.
- Arduino Uno Rev3 (1x)
- HC-SR04 Ultrasonic Distance Sensor (2x)
- Micro Servo Motor (1x)
- DC Hobby Motor (1x)
- Propellor (1x)
And these were some possible extensions:
- Temperature Sensor (1x)
- Bluetooth Module (1x)
- HC-SR04 Ultrasonic Distance Sensor (More)
*(Name stolen from inspired by Rob|Arch)