1

我的项目是使用语音识别来控制车窗。我已经使用 EasyVR arduino shield using 和 arduino MEGA 成功控制了一些 LED。现在我想使用 CAN-BUS arduino shield 来控制窗户。

因为我拥有的汽车没有 OBD-II 连接器,所以我使用了两个带有两个 CAN-BUS arduino 屏蔽的 arduino,一个作为发送器,另一个作为接收器。现在我不知道如何编程 CAN-BUS arduino shield 来模拟汽车的窗户?

我正在使用的 CAN-BUS 屏蔽:https ://www.sparkfun.com/products/10039

Arduino巨型:https ://www.sparkfun.com/products/11061

4

3 回答 3

1
  1. CAN 总线是一种通信协议(类似于 RS485,但更可靠)。它本身不控制任何东西。
  2. 如果车窗、大灯或其他设备由 I/O 控制,并且 I/O 与 CAN 总线通信,那么您可能能够控制车窗、大灯等。
  3. Arduino 的 CAN 总线屏蔽具有带 MCP2551 CAN收发器的 Microchip MCP2515 CAN 控制器,因此您不需要其中的 2 个。

我们正在与同事合作进行电动汽车项目,我们能够使用 Arduino 和 CAN 总线屏蔽进行监视和控制。

如果您想控制窗口,我会考虑尝试此设置的可能性:

  1. 断开窗户与按钮和电源的连接。
  2. 放 2 个继电器,有 H 桥(上下移动)来控制车窗电机http://www.ebay.com/itm/1pcs-5V-2-Channel-Relay-Module-for-Arduino-PIC- ARM-DSP-AVR-电子-/261099571172?pt=LH_DefaultDomain_0&hash=item3ccabf47e4
  3. 放置一些限位开关,当窗户关闭或完全打开时打开继电器。
  4. 使用 Arduino 控制这些继电器。

在我看来,这将是最简单的方法。而且你不必去扔CAN总线。

编辑 还提供一些汽车规格。如果它没有 OBD II 插座,它可能不是新的,所以我猜是用按钮控制窗户。

于 2014-05-16T13:28:04.060 回答
0

The CAN shield can be both a receivers and a transmitter, you shouldn't need two of them (unless you are bridging two networks together.

Unfortunately, operating the windows is not something for which there is a standard message. And indeed the window controllers may actually be on a LIN bus (not CAN). I'm not sure there is a LIN shield, but it's a relatively simple physical layer chip and a UART, so you should be able to rig something up.

Then you will have to reverse engineer the messages...

If you can find out from a workshop manual what the CAN/LIN buses look like, you should be able to find somewhere to tap into the right bus.

Then monitor the bus and operate the window switch to see if a new message appears, or if some particular bits change in a regular message. There will often be sequence counters and checksums within the messages which you will also have to understand in order to correctly replay the appropriate message.

于 2014-04-10T09:42:44.973 回答
0

Windows 由作为 CAN SUB BUS 的 LIN BUS 控制。它是串行单线通信。最简单的方法是在您的 Arduino 上使用 lin 收发器芯片,这样您就不会打扰自己检测中断,只需在 Rx 中接收并在 tx 中传输。然后你需要监听LIN Bus并检测打开或关闭窗口时使用的ID,一旦检测到ID和数据包数据,你就可以重播它。

于 2019-08-06T01:27:41.773 回答