[关闭]
@plantpark 2014-07-27T03:42:34.000000Z 字数 4076 阅读 2947

可重复使用的无线点火器

原文链接 作者:nodcah 翻译:plantpark

arduino 无线


1.简介

这个项目使用一个simple RF link无线通讯套件和两个Arduino做成的可以从90英寸远的地方进行点火。已经厌倦了绕来绕去电线的我,希望能有些突破。so 无线点火器诞生了,不仅更加安全,而且看着非常酷呢。它不仅可以用来点爆竹,模型火箭,还有更大的想象空间。

申明:制作和使用点火器时一定要注意安全,对因此造成的安全事故,本人不承担任何责任。

2.清单

2.1材料

元件 供应商 价格
Arduino Uno REV 3 x2 Sparkfun buying guide, Radioshack $50-60
RF Link Transmitter - 434MHz Sparkfun/Sparkfun $9
外壳 x2 Sparkfun $7-12
拨动开关 Sparkfun $3-5.50
单刀双掷滑动开关 x2 Sparkfun $.75-4
喇叭(可选) Sparkfun $2-4
点火器 Amazon $6
LEDs Sparkfun $1-5.50
5V 继电器 Sparkfun $2-5
电阻包 Sparkfun 815
8针插座 Sparkfun $1-2
总计 ~$85-130

2.2工具:

3.组装

3.1 电路原理图

根据下面照片中的电路原理图搭建电路。

电路设计成,当发射端发射信号后,触发器点火前会五秒倒计时

注意:我发现,让点火器正常工作的电线尺寸要比跳线甚至面包板线粗一些。所以,用鳄鱼夹直接将点火器的接头连接好是非常有必要的。

3.2 制作点火器

我使用的点火器是为遥控汽车点燃油气混合物而设计的。在1.5V下即可正常工作,炙热的内芯开始燃烧。提供一种类似硝化棉的引火材料(可以在低温下点燃,并能燃烧产生高温)或者在点火器内芯处放一个很小的保险丝是非常必要的。

一个AA电池不足以让点火器正常运行,所以,我制作了一个电池盒可以让两个电池并联。然后将用鳄鱼夹链接点火器。

电池盒:

1.)将街头一侧的弹簧取下
2.)将弹簧焊接在对面,这样两个弹簧就在电池盒的同一侧了。
3.)确保电池盒两侧是接通的,然后分别从两侧焊接一根线出来
4.)作品最终的形态最有有显示

鳄鱼夹:

1.)将一个大鳄鱼夹的两侧砸平
2.)用电钻在鳄鱼夹的一侧打直径15/64"的孔
3.)将点火器拧到这个孔里并用电烙铁在高温(我用的时400℃)下焊接(或者用尺寸正好1/4 x 28的螺丝)
4.)将两根线分别缠到鳄鱼夹的手柄上
5.)将一根线焊接到点火器一头,另一根接到中间的位置
6.)最终效果如上图所示

3.3 放在盒子内

首先,钻几个小孔,然后将元件与边缘大小相匹配。如果使用扬声器,请多钻几个孔布成矩阵。

为将盒子紧固,我制作了一个适应arduino的小外壳。我同样希望重复使用接收器和发射器,所以我把它们放在如图所示的IC插座。
I used some foam I cut to hold the arduino in place, but standoffs and screws would work too.

我用了些海绵将arduino固定到位,同样支撑和螺丝也能起作用。

4 软件

4.1 安装 VirtualWire库

这个项目中所有涉及的代码均是围绕一个叫VirtualWire的arduino库实现的。这个库将廉价无线模块的功能发挥到了极限。

1)可以在这里直接下载代码,或者访问网站下载

2)根据Arduino IDE的配置,找到sketchbook文件夹的位置

3)看是否有“libraries”的文件夹,若没有则新建一个,然后将VirtualWire放在文件夹内。

4)打开Arduino软件,这样VirtualWire库安装完成。

4.2 写Virtual Wire代码

接收端代码

  1. // Receiver by Noah DC
  2. // This code is built around the VirualWire library which
  3. // can be found here: http://www.airspayce.com/mikem/arduino/
  4. // Visit my instructable for the wiring, explaination, etc.
  5. // http://www.instructables.com/id/The-Reusable-and-Wireless-Igniter/
  6. const int recieverPin = 2; //to reciever module
  7. const int ignitionPin = 3; //to igniter
  8. const int activeIndicatorPin = 5; //to green LED
  9. const int inactiveIndicatorPin = 6; //to red LED
  10. const int buzzerPin = 4; //to the buzzer
  11. #include <VirtualWire.h>
  12. boolean liftOff= false;
  13. void setup(){
  14. Serial.begin(9600); //for debugging
  15. pinMode(activeIndicatorPin, OUTPUT);
  16. pinMode(inactiveIndicatorPin, OUTPUT);
  17. pinMode(ignitionPin, OUTPUT);
  18. vw_set_ptt_inverted(true); //normal setup stuff
  19. vw_setup(2000);
  20. vw_set_rx_pin(recieverPin);
  21. vw_rx_start();
  22. }
  23. void loop(){
  24. while(liftOff == false){
  25. digitalWrite(activeIndicatorPin, HIGH); //shows that igniter hasn't been used yet
  26. uint8_t buf[VW_MAX_MESSAGE_LEN];
  27. uint8_t buflen = VW_MAX_MESSAGE_LEN;
  28. if (vw_get_message(buf, &buflen)) {
  29. Serial.print("Got: ");
  30. Serial.print(buf[0], DEC); //only one byte in the array (it should be 97)
  31. Serial.println(" ");
  32. }
  33. if (buf[0] == 97){ //checks if the letter "a" is recieved (ASCII number is 97)
  34. liftOff = ignition();
  35. }
  36. }
  37. }
  38. int ignition(){
  39. tone(buzzerPin, 500, 300); //5 second countdown
  40. delay(1000); //it's not necessary, and can be removed
  41. tone(buzzerPin, 500, 300); //4 (I relize it's not exactly a second)
  42. delay(1000);
  43. tone(buzzerPin, 500, 300); //3
  44. delay(1000);
  45. tone(buzzerPin, 500, 300); //2
  46. delay(1000);
  47. tone(buzzerPin, 500, 300); //1
  48. delay(500);
  49. //ignition!!
  50. digitalWrite(ignitionPin, HIGH);
  51. delay(2000);
  52. digitalWrite(ignitionPin, LOW);
  53. digitalWrite(activeIndicatorPin,LOW);
  54. digitalWrite(inactiveIndicatorPin,HIGH); //shows that igniter has been used
  55. return true; //prevents other ignitions for safety purposes
  56. }

发射端代码

  1. // Transmitter by Noah DC
  2. // This code is built around the VirualWire library which
  3. // can be found here: http://www.airspayce.com/mikem/arduino/
  4. // Visit my instructable for the wiring, explaination, etc.
  5. // http://www.instructables.com/id/The-Reusable-and-Wireless-Igniter/
  6. const int transmitPin = 2; //pin to the transitter module
  7. const int buttonPin = 3; //pin to ignition button
  8. const int armedPin = 4; //pin for indicator LED
  9. #include <VirtualWire.h>
  10. void setup() {
  11. pinMode(armedPin, OUTPUT);
  12. digitalWrite(armedPin, HIGH); //shows that igniter is armed
  13. vw_set_ptt_inverted(true); //setup stuff
  14. vw_setup(2000);
  15. vw_set_tx_pin(transmitPin);
  16. }
  17. void loop() {
  18. char *msg = "a"; //going to send the char "a"
  19. if (digitalRead(buttonPin) == 1) {
  20. digitalWrite(13, HIGH); //blink LED to show it's working
  21. vw_send((uint8_t*)msg, 1); //sends the char
  22. vw_wait_tx(); //wait until the char is sent
  23. digitalWrite(13, LOW);
  24. delay(500);
  25. }
  26. }

5 成果

终于,一个无线点火器诞生了,除了点爆竹外,还有更多有意思的应用值得你去发现哦~~

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注