Pages: [1]   Go Down
Author Topic: [ArduinoBT] Anti-Hijack function and PIN13  (Read 681 times)
0 Members and 1 Guest are viewing this topic.
Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I already got my ArduinoBT communicating with my phone and the phone sends the GPS speed over to Arduino to control a dozen LEDs. I also control some relays to turn on my engine of my motorcycle. I was thinking about making an anti-hijack function, if my phone disconnects from the BT module then I want to switch off the engine. (I can ofcourse overwrite this with a key switch in case my phone runs out of battery or something)

  • I saw some extensions of the libary serial, including the function list(). What is the best practice to get feature done? Using that extended libary, or send a command over to my arduino every 3 seconds to see if their connected? (like trains do?)
     
  • I also made a PCB but totally forgot that PIN13 is used for the LED, is it harmful to use this PIN to control a relay? like if the LED dies, can I still use that PIN?

Thanks!
Logged

Offline Offline
Edison Member
*
Karma: 4
Posts: 1722
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Odds are the pin will die before the led,
it can still controll a transistor to drive a relay yes, except you should ty not to draw as much current on that pin( <20) to be safe
and yeah you will need to do something like that, can't see any other way, its not like a serial communication can tell if the absence is because of nothing being sent or disconnected
I don't have a arduinobt but I have a bluetooth to serial module, and while it doesn't indicate a disconnection perhaps the arduino bt can, if you can send commands to thr module, perhaps you can check a connected flag or get a disconnect flag
Logged

Offline Offline
God Member
*****
Karma: 0
Posts: 547
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use the handshake lines DTR and RTS you can detect a connection loss.
Logged

Pages: [1]   Go Up
Jump to: