This week I started testing out different sensors to find their ranges.
PIR MOTION SENSOR TEST
I initially thought that I was going to use PIR motion sensor as one of the sensors. I did some testing and was getting very strange and fractured feedback. And the sensor does not seem like the best option for this project. For no motion I was getting a range of 912-914. For Some motion I was getting a range of 284-299. Very rarely would I get a reading in the 100s.
The way the sensor reads the input is a bit much for sensing the proximity of someone to, say, a stuffed dog’s face.
HC- SR04 – ULTRASONIC DISTANCE SENSOR
In the first three tests, I got back varying results of two integers: 1 or 2, 37 or 38, and 7 or 8. I tried a few more times and got some more random readings, with a 1023 popping up every now and then. I was unsuccessful at getting a good read out of this. But perhaps that is because the basic program for ArduinoReadSerial doesn’t apply to this sensor since it has 4 pins. I found this great tutorial that mentions the range is about 0,200 at the max.
I tried reconnecting and reading both the trig and echo and got a reading of 1023 and 987-990.
Two videos that I watched (the one above and this one) had the sensor connected to the digital pins, not the analog pins.
THE (NEW) PLAN:
PHASE I: Tail Wagging
- Use the code to get the distance in centimeters. Map the distance to 0, 1023 which will control the speed of the motor like the potentiometer did in this lab. This will be for the tail wagging.
- Decide on the motor for the tail after testing out the DC motor first.
PHASE II: Eyes
- Develop robotic eyes.
- Figure out a sensor that the eyes can be controlled with (wether it be the same as the tail)
PHASE III: Connect
- Connect and map the tail and eyes to an accelerometer
- Change out Arduino for Arduino Mini
Phase IV: Casing/Prototype
- Put together in some sort of visual order.
- Time willing, Insert the above everything into a stuffed animal prototype