Welcome back to the Digilent Blog!
上次, I showed my initial attempt into living out my dream of performing magic tricks (with a little help from the electronic realm), and found that my “oh yeah, sure, no problem” attitude was not going to work. So I came up with a new plan of using thePMODMAXSONARas an input for my desired height and using aPmodOD1orPMODOC1作为我控制球迷速度以四英尺悬浮球悬浮的方法polycarbonate tube。Let’s see how that turned out.
我肯定与这一战斗一段时间了,因为我太固执而不能屈服,至少不像我第一次尝试那样容易。我确实看到了一些成功,并学到了很多关于可用性,可靠性和努力使前两个项目可行的平衡之间的平衡。In principle, I would receive distance information from the PmodMAXSONAR (since it’s a nice ultrasonic sensor to detect objects, such as my hand, that are located in front of it), which I would then process within the microcontroller to see the measured distance is within my desired sensing range.
如果报告的距离在6到36英寸之间,我让微控制器计算一个相应的占空比,以使用PMODOC1运行风扇(我决定反对PMODOD1,因为我的小风扇不需要PMODOD1能够提供的电流太多)作为我将5V电源切换到风扇打开和关闭的方法。那是我开始遇到一些问题的时候。
The first was that I didn’t stop and consider what the ‘OC’ meant in reference to the PmodOC1—it means open collector. This means that the collector portion of theNPN BJT没有连接到通常会连接到的正电压供应,这意味着只需将PMODOC1上的输出与您尝试运行的任何内容连接起来都不会做任何事情(正如我发现的那样)。相反,您尝试运行的任何方法都需要附加到PMODOC1(收集器)上的输出和正线(或LED的阳极)上的地面,需要将其附加到您的正电源上。如下图所示,这种配置将允许电流流过系统。
弄清楚这一点后,我迅速发现,一旦风扇达到一定的速度,乒乓球就会一直一路传播到管的顶部,而在高度方面没有比例的方面。事实证明(正如我应该已经意识到的那样),如果您想要比例的高度控制,则需要实施一种方法来实现能量变化(增加或减少)发生。因为我们希望风扇随着测得的手高度的增加而更强烈地吹来,所以我们需要慢慢增加管子从试管中释放的空气量,因为球在空气中浮动在空气中浮动,从而钻出一英寸大约一英寸的小孔向上管。
在这项工作中,我取得了巨大的成功 - 一切都尽可能地工作。然后瞬间结束。
Apparently, when you use things in way that they are not designed to be used, like rapidly turning a DC fan on and off, they tend to deteriorate as evidenced when I found that having the fan on full blast only floated the ball a third of the way up the tube rather than threatening to blow it out of the tube entirely. Additionally, the PmodMAXSONAR, while great in principle, proved to not be as user friendly as I originally envisioned. As an ultrasonic range finder, it does best at detecting flat objects such as a wall or ceiling whereas the human hand tends to have multiple curves, so a clean ultrasonic signal is not returned to the Pmod. Also, people are never quite sure if their hand is directly above the PmodMAXSONAR, leading to some skewed results.
考虑到所有这些PmodACL2that I can tilt and measure the acceleration from to execute height control, a DC fan designed to be controlled by aPWM信号消除了对PMODOC1的需求),并且更高的支架可以实现更多的气流。

Great project. I want to ask what dc fan do you use on this project? are you using a 1-3/4 diameter tube? it would be really great if you can share some specs on this project. I’m currently creating the same project but the dc fan i bought was just not strong enough to levitate the ping pong ball. i might be using a wrong diameter for my tube as well, 2 inch which i think its too big. I appreciate if you can email me your specs on this project despite the lateness of this comment.
Hello!
I apologize for the lateness of my reply. The fan I ended up using in the final iteration,https://blog.digilentinc.com/levitating-a-ping-pong-ball-obliterating-all-obstacles/,这是:http://www.mouser.com/productdetail/sanyo-denki/9ga0405p6f001/?qs=sgaepimzzmt9ms9kroxcw0cyysysnw7gy%%2FGDVKDVKPA5EAHC%3D。
The tube that I used,https://www.amazon.com/dp/B000OMHJJO/ref=biss_dp_t_asn,内径为1.625英寸,因此比风扇的一侧大一点(40毫米),但仍然可以放在风扇的角落上。我确保的最大的事情是,风扇的圆形部分或多或少地“填满”了管子的直径,因此管子内部没有任何死空间。
谢谢,
詹姆斯·科尔文(James Colvin)
您的问题是这些粉丝有一个单独的PWM控制线 - 您应该使用它而不是PMOD OC1。
Hi.
乒乓球上的红色和黑色一面有什么区别?