Jump to content

rpi 'floating' eyeball build - DONE! Links to videos included

steelo

 

Hi everyone,

 

Halloween is about 6 weeks away and I've been working on a Halloween project for work, utilizing a rpi3, an adafruit dc motor HAT, stepper motors, a ping pong ball, a webcam and magnets! What I am contemplating is an 'eyeball' in a glass mason jar that turns to follow those who dare pass by.  I'm only about 25% complete (I believe the software side is all functional at this point...it's just a matter of waiting on parts and assembly) Here's what I have so far...

 

Initially testing tracking software with a pi zero...quickly realized it's just too slow to be able to effectively 'follow' an object. I was planning on using r/c car servos I had laying around the house, but running servos directly off of the I/O pins (as evidenced in the video) results in very imprecise and jerky movement. Ordered a pi3, an Adafruit DC motor HAT and 2 stepper motors...

Link to comment
Share on other sites

Link to post
Share on other sites

The pi3 has finally arrived! For $35, it came with a case, power supply, and a USB flash drive (which kind of is useless)

20190913_165916.jpg

 

 

After installing Raspbian buster and OpenCV, I found open source python code for a 'pi nerf turret' From what I understand of his code, it appears to convert an image to grayscale, sharpen the contours and then draw a box around it. The code will then control 2 stepper motors to attempt to center the object in its field of view. Pretty cool! Here is his 'hackster' page...https://www.hackster.io/hackershack/raspberry-pi-motion-tracking-gun-turret-77fb0b

 

I am going to have to edit his code a bit, mainly to make the stepper motors react faster and this project doesn't require manual control of the motors.

 

 

20190915_153913.jpg

 

 

For this project, I will be using stepper motors to pan and tilt the magnets all controlled by a stepper motor HAT. The 'eye' will also have magnets on the inside and if all goes well, it will look like magic ? 

 

At this point, I am waiting for a set of flanged couplers to arrive from Amazon which allow me to mount hardware to the motor drive shaft. What I am trying to determine at this point as I think over everything is whether the camera needs to move in tandem with the pivoting mechanism or remain stationary. I also need to think of a clever way to hide the it...

20190916_190554.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

As I progress, I'll post updates if anyone is interested. Just for the record, I am not a coder and probably don't have 1/10 the computer knowledge others have on here...Everything I've learned is through extensive google and forum searches (not even knowing what I'm looking for) and almost burning my house down through trial and error.

 

Basically, I'm just a nerd who finds tinkering with credit card sized computers and electronics to be good fun ?

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Created the pan/tilt mechanism tonight using some electrical boxes I had laying around. Had to alter them a bit with a dremel - I know it ain't pretty but they should serve their purpose and will be out of sight...I really wish I had a 3d printer...

 

Once I finalize the mounting locations, I'll tidy up the wiring a bit!

 

 

The tracking seemed to work okay, but not great. I believe much of the problem was the posters I had hanging on the wall behind me and the small size of the room. I need to test it on an empty wall...another issue I'm having are the painfully slow frame rate which look to be around 1-2 fps. That seems to be hurting the overall tracking responsiveness quite a bit. I'm not sure how I can improve this...=(

20190919_203638.thumb.jpg.99ff6280cb46d4f17c298ad23614b873.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

Subscribed! +1 

Super cool project! ?

CPU: Ryzen 5800X3D | Motherboard: Gigabyte B550 Elite V2 | RAM: G.Skill Aegis 2x16gb 3200 @3600mhz | PSU: EVGA SuperNova 750 G3 | Monitor: LG 27GL850-B , Samsung C27HG70 | 
GPU: Red Devil RX 7900XT | Sound: Odac + Fiio E09K | Case: Fractal Design R6 TG Blackout |Storage: MP510 960gb and 860 Evo 500gb | Cooling: CPU: Noctua NH-D15 with one fan

FS in Denmark/EU:

Asus Dual GTX 1060 3GB. Used maximum 4 months total. Looks like new. Card never opened. Give me a price. 

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, DoctorNick said:

Subscribed! +1 

Super cool project! ?

Thanks! I'm basically learning as I go! 

 

I may be changing my original idea up a bit, which should add a bit of creepiness (and hilarity) Originally I was planning on using a floating eyeball that appears to 'follow' whatever passes by, but a coworker bought me a super creepy Michael Jackson mask that is just too tempting to pass up using...so, why not do both!

 

 

The blue 'tray' does serve a purpose, it is to house a stack of very strong neodymium magnets to move the 'eyeball' (which will also have magnets mounted on the inside). 

 

I will have to find another suitable location to mount the camera ?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

For those who are following this project...I have not given up on it, just taking a much needed vacation this week with my wife! ?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I am still waiting on 8mm neodymium magnets but last night I made an attempt at slicing a ping pong ball in half...it's a lot more difficult than I imagined it would be. My plan is to mount the magnets and weights with strategically placed hot glue. The tricky part will be adding just enough weight to make it semi-buoyant since I am wanting the eyeball to float in the middle of the jar.

 

Once everything is situated, I will glue and seal the two halves with silicone, sand and smooth it as necessary to conceal the seam, then finally paint the 'eyeball'

 

 

20190929_221525.jpg

Link to comment
Share on other sites

Link to post
Share on other sites

Here is the floating 'eyeball' I made. Basically, it's a ping pong ball inside of a balloon with the end still intact (to look like nerve endings) I spray painted it white, painted the nerve ending red and drew a 'pupil' ?

20191006_163452.jpg

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

 

 

Testing with a makeshift table. My wife walked into the room and it caught her

 

Can you find the magnets? ?

 

https://drive.google.com/file/d/1MYKm2AWdVEavG637W4t5ucpXEEB4GDdY/view?usp=sharing

 

 

 

Final product. Used a $3 wastebasket cut to size as a stand and added a slot for camera view

 

https://drive.google.com/open?id=1HxcOHr4lO3GZq27zqO4ug5qyoOvRQFR0

 

 

 

 

Conclusion: Overall, I'm quite happy that I was able to complete this. The tracking on it really isn't great and it often gets confused when there are other objects in its field of view. I'm noticing that there is a lot of wobbling during panning and tilting, which I didn't notice before. I'm sure the wobbling could be causing tracking problems as the video undoubtedly is shaky.

 

It will be fun watching my coworkers try to figure out how the eyeball is moving with no strings ?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×