PE 13: Connecting security sensors to Arduino

Discussion of the online video show SuperHouseTV, where Freetronics co-founder Jonathan Oxer hacks on his house using various Open Source hardware and software. [SuperHouseTV site]
chrishiscox
Posts: 3
Joined: Tue May 12, 2015 2:22 pm

Re: PE 13: Connecting security sensors to Arduino

Post by chrishiscox » Sun Aug 30, 2015 10:40 pm

Hi josh, you may want to include the third resistor, which goes from A3 to 0V. This will give better results from a security point of view where if the circuit is disconnected ie the feed wires cut, the analog pin will be pulled down to 0V which can be Read as 0 to 30, I use a value of 30 to reduce any noise triggers. This resistor is 2k2 in my circuits, and always located at the arduino end of the line.

Cheers
Chris Hiscox

josh
Posts: 3
Joined: Wed Aug 26, 2015 10:55 pm

Re: PE 13: Connecting security sensors to Arduino

Post by josh » Wed Sep 23, 2015 2:30 pm

The security sensor shield (SECSENSE shield) arrived. I have it on top of a standard Uno, and then the Arduino Ethernet shield on the very top.

I'm using the shield to provide power to the sensor, which is a Bosch TriTech and is pretty standard in terms of voltage/current. 10mA at 12VDC with an operating range of 9-15VDC. ( https://us.boschsecurity.com/us_product ... otion_4944 )

The transformer is providing a steady ~12VDC.

I was able to publish alarm events to MQTT (and receive them on my computer) and all was great, until about 3-4 minutes in, when it stopped working. I then noticed that the lights on the ethernet shield went out. After unplugging for a few minutes and back in, it worked, then the same result after only a minute. The chip next to the DC barrel input jack (which I can only guess is the voltage regulator?) is getting super hot.

While I have not taken any measurements of current yet, the logical conclusion, I think, is that the components are drawing too much current, hence the overheating and loss of power to the Ethernet shield. I could be wrong, but after this happens it looks like even the detector takes too long to trigger an event, perhaps browning out for the same reason the ethernet shield is.

Jonathan, in his superhouse video, was using a different board and did not show ethernet attached though no doubt he did this when mounted to the wall in the end.

My question is basically what to do next? It's working perfectly, but overheating. I don't know enough about the SECSENSE shield to know how to proceed. Freetronics experts, please help!

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: PE 13: Connecting security sensors to Arduino

Post by angusgr » Thu Sep 24, 2015 4:57 am

If you think the regulator on your Uno is overheating, you could consider getting a Freetronics EtherMega or EtherDue. Both those boards use higher efficiency switchmode converters, so they will run cooler. (The EtherTen has a linear regulator same as the Uno, so it doesn't have the same advantage.)

You may also want to measure the voltages involved in your current circuit with a multimeter, just to be sure it's not a problem with the power supply or something else.

josh
Posts: 3
Joined: Wed Aug 26, 2015 10:55 pm

Re: PE 13: Connecting security sensors to Arduino

Post by josh » Thu Sep 24, 2015 3:29 pm

chrishiscox wrote:Hi josh, you may want to include the third resistor, which goes from A3 to 0V. This will give better results from a security point of view where if the circuit is disconnected ie the feed wires cut, the analog pin will be pulled down to 0V which can be Read as 0 to 30, I use a value of 30 to reduce any noise triggers. This resistor is 2k2 in my circuits, and always located at the arduino end of the line.

Cheers
Chris Hiscox
Chris, thanks for the reply and sorry I missed it. Actually the two resistors shown in my initial diagram are not EOL resistors, they are there on the board in lieu of the sensor shield which I didn't have at the time, just as Jonathan showed in the video -- I have the three EOL resistors as used in the video at the sensor itself and can detect all events: line cut, line short, alarm, tamper.

Now that I have the sensor shield I'm using it instead and only have the EOL resistors, but as noted above I'm having power issues. I'll investigate this sometime later this week when I have time.

Treborjm87
Posts: 13
Joined: Fri Sep 25, 2015 4:01 am

Re: PE 13: Connecting security sensors to Arduino

Post by Treborjm87 » Mon Oct 05, 2015 4:00 pm

FIRST... I'm a newb to home automation, and am very happy to find these videos. So, thanks!

And...
What brand of sensor is used for the motion sensor? I've seen several on eBay, but can't seem to find one that seems to have the same features as what is in the video. Thanks for any help.

Rob

Bordwalk2000
Posts: 4
Joined: Tue Oct 06, 2015 3:47 pm

Re: PE 13: Connecting security sensors to Arduino

Post by Bordwalk2000 » Tue Oct 06, 2015 4:08 pm

koos147 wrote:I just checked it again and from 11:40 there is no sound anymore
I normally listen to youtube with headphones in only one ear and I was having the same problem.

The video at that time drops the right audio channel and sound only comes out of the left.

The right side of the audio channel doesn't come back until 26:05, right at the end of the video.

Bordwalk2000
Posts: 4
Joined: Tue Oct 06, 2015 3:47 pm

Re: PE 13: Connecting security sensors to Arduino

Post by Bordwalk2000 » Tue Oct 06, 2015 4:11 pm

I can't get the arduino code that you posted for this project to compile.

https://github.com/SuperHouse/SecurityS ... ToMQTT.ino

I do really appreciate it getting posted to GitHub though. Thank you for that.

chrishiscox
Posts: 3
Joined: Tue May 12, 2015 2:22 pm

Re: PE 13: Connecting security sensors to Arduino

Post by chrishiscox » Tue Oct 06, 2015 10:46 pm

Mr Bordwlk.
Please post the error window contents. The first four or five lines will show the error.
Chris

Bordwalk2000
Posts: 4
Joined: Tue Oct 06, 2015 3:47 pm

Re: PE 13: Connecting security sensors to Arduino

Post by Bordwalk2000 » Thu Oct 08, 2015 8:07 pm

chrishiscox wrote:Mr Bordwlk.
Please post the error window contents. The first four or five lines will show the error.
Chris
Thank you sir.

I haven't changed anything from the github SecuritySensor4ToMQTT.ino file

Line 113 in the SecuritySensor4ToMQTT.ino file is as following.

Code: Select all

PubSubClient client(server, 1883, callback);
Here are the first couple of error codes from trying to compile..

Code: Select all

Using library SPI in folder: C:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\arduino\avr\libraries\SPI 
Using library Ethernet in folder: C:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\Ethernet 
Using library PubSubClient in folder: C:\Users\ladmin\Documents\Arduino\libraries\pubsubclient 
Using library Wire in folder: C:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\arduino\avr\libraries\Wire 
Using library SD in folder: C:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\SD 
Using library FTOLED in folder: C:\Users\ladmin\Documents\Arduino\libraries\FTOLED 

C:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\arduino\avr\cores\arduino -IC:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\arduino\avr\variants\standard -IC:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\arduino\avr\libraries\SPI -IC:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\Ethernet\src -IC:\Users\ladmin\Documents\Arduino\libraries\pubsubclient\src -IC:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\hardware\arduino\avr\libraries\Wire -IC:\Users\ladmin\Downloads\arduino-1.6.5-r5-windows\arduino-1.6.5-r5\libraries\SD\src -IC:\Users\ladmin\Documents\Arduino\libraries\FTOLED C:\Users\ladmin\AppData\Local\Temp\build5976994845086395901.tmp\SecuritySensorToMQTT.cpp -o C:\Users\ladmin\AppData\Local\Temp\build5976994845086395901.tmp\SecuritySensorToMQTT.cpp.o 
SecuritySensorToMQTT.ino:113:43: error: no matching function for call to 'PubSubClient::PubSubClient(byte [4], int, void (&)(char*, byte*, int))'
SecuritySensorToMQTT.ino:113:43: note: candidates are:
In file included from SecuritySensorToMQTT.ino:36:0:
C:\Users\ladmin\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:99:4: note: PubSubClient::PubSubClient(const char*, uint16_t, void (*)(char*, uint8_t*, unsigned int), Client&, Stream&)
    PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client, Stream&);
    ^
C:\Users\ladmin\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:99:4: note:   candidate expects 5 arguments, 3 provided
C:\Users\ladmin\Documents\Arduino\libraries\pubsubclient\src/PubSubClient.h:98:4: note: PubSubClient::PubSubClient(const char*, uint16_t, void (*)(char*, uint8_t*, unsigned int), Client&)
    PubSubClient(const char*, uint16_t, MQTT_CALLBACK_SIGNATURE,Client& client);

KAJETALK
Posts: 2
Joined: Mon Dec 21, 2015 10:26 pm

Re: PE 13: Connecting security sensors to Arduino

Post by KAJETALK » Mon Dec 21, 2015 10:31 pm

It looks like PubSubClient has updated code which break the SecuritySensor4ToMQTT code

What is required now by PubSubClient is the following:
PubSubClient (server, port, [callback], client, [stream])

Creates a fully configured client instance.
Parameters

server : the address of the server (IPAddress, uint8_t[] or const char[])
port : the port to connect to (int)
callback : optional a pointer to a message callback function called when a message arrives for a subscription created by this client.
client : an instance of Client, typically EthernetClient.
stream : optional an instance of Stream, used to store received messages. See the mqtt_stream example for more information.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests