• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Idea: PIR wireless motion sensor
#31
I figure out , but no garanty :
pin 2 transmitter and pin 3 one wire
 
Reply
#32
Correct
 
Reply
#33
I have build the ds18b20 setup and programmed a attiny85 with curlymo's code today.
[Image: attiny45_85pinout.png]
I have connected ds18b20 data to Pin4(analog input 2)-connection 3 and the 433 MHz transmitter data to Pin3(analog input 3)-connection 2. Every now and then the transmitter sends:
Code:
pi@raspberrypi ~/433onewire $ sudo pilight-debug
Now press and hold one of the buttons on your remote or wait until
another device such as a weather station has send new codes
It is possible that the debugger needs to be restarted when it does
not show anything. This is because it's then following a wrong lead.
--[RESULTS]--

hardware:       433lirc
pulse:          3
rawlen:         104
binlen:         26
pulselen:       587

Raw code:
587 2935 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 587 587 1761 587 19958
Binary code:
00000000000000000000000001
So a shitload of zero's?? One more thing, between sending datablocks (the two minutes in between) the output of the attiny is HIGH so the transmitter is activated and thus blocking other signals.
 
Reply
#34
@Zatta


Quote:What is next?


Like you did with Curlymo's code, use a pulsetrain at wish to notify piilght that there is movement.

So next thing would be a DIY protocol Wink

Other thinks should be looked into like, battery status, etc etc
 
Reply
#35
rawlen = 104

Header rawlen = 2 : 587 2935
Footer rawlen = 2 : 587 19958

104 - 4 leaving 100 pulses for data like in this case:

8 bits = ID
1 bit = negative
8 bits = Temperature
8 bits = Temperature / 100

8+8+8+1 = 25 bits make out of 100 pulses

So every four pulses after the header are a high or a low bit:

587 0 header
2935 1 header
587 0 1st bit
587 0 1st bit
587 0 1st bit
1761 1 1st bit

your pulsetrain shows only 25 times 0001 ???

Gonna buy some sensors so I can play to Wink First want to check the differences.

conserve power if higher resolutions are not required

"The DS18B20 differs from the DS18S20 in an important respect: the designer can select the desired resolution by using the configuration register. This flexibility allows the user to reduce the ADC conversion time and conserve power if higher resolutions are not required."
 
Reply
#36
If it send just 0's then the sensor isn't connected properly.
 
Reply
#37
(01-31-2014, 06:43 PM)curlymo Wrote: If it send just 0's then the sensor isn't connected properly.
You were right, renewed some wires and now:
Code:
Raw code:
588 2940 588 1764 588 588 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 1764 588 588 588 588 588 1764 588 588 588 1764 588 1764 588 588 588 1764 588 588 588 588 588 1764 588 1764 588 588 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 1764 588 588 588 1764 588 588 588 1764 588 588 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 588 588 1764 588 19992
Binary code:
10000001001101000011100001
I can't use it because I have no idea how to read this into pilight (or actually, how to read it all Smile ) C is difficult an sich, C for attiny is an extra dimension, even my chinese is better....
One problem with the current code is (as I've said before) it sets the output to high and fills the ether with a solid signal so other stuff is not detected anymore. But this is a good start and when time permits I'll start looking in C/attiny stuff more. Now back to java.
 
Reply
#38
10000001 0 01101000 01110000 1

Then:
http://www.mathsisfun.com/binary-decimal...erter.html

10000001 = 129
0 = positive
10110 = 22
1110 = 14

22.14C

Can you change line #286 from:
Code:
            if(state == 1) {
to
Code:
            if(state == 0) {
 
Reply
#39
(01-31-2014, 11:58 PM)curlymo Wrote: 10000001 0 01101000 01110000 1

Then:
/binary-decimal-hexadecimal-converter.html

10000001 = 129
0 = positive
10110 = 22
1110 = 14

22.14C
Thanks, that is nice. Is there a way already to get this read by pilight? In a protocol?
Quote:Can you change line #286 from:
Code:
            if(state == 1) {
to
Code:
            if(state == 0) {
Sorry, that doesn't do the trick. But now I'm going for a sleep, ciao!
 
Reply
#40
Of course you can create a protocol of it. Check the pilight website and the pilight_firmware protocol for reference. This has not much to do with C but just using the pilight internal API.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  using serial/uart to connect a CO2 sensor behrisch 15 7,855 10-15-2021, 01:48 AM
Last Post: DesmondOrask
Question 433mhz wireless sensor for dormer window milde 3 4,940 12-06-2015, 07:18 PM
Last Post: pilino1234
  weatherstation sensor p4co86 37 27,733 02-15-2015, 07:46 PM
Last Post: pilino1234
  TFA-Dostmann T/H-sensor not in pilight-receive fozed 0 3,454 02-10-2015, 12:59 PM
Last Post: fozed
  wired sensor Brn 3 4,017 11-29-2014, 11:36 AM
Last Post: curlymo
  Conrad no name wireless switch keesse 9 9,207 09-11-2014, 07:40 AM
Last Post: wo_rasp
  ELV power consumption sensor p4co86 0 3,189 07-06-2014, 05:40 PM
Last Post: p4co86
  Arduino sensor jpoilux 1 4,032 07-02-2014, 07:21 PM
Last Post: curlymo
  About RF and Wireless, useful links... Gregstah 0 2,319 02-12-2014, 02:23 PM
Last Post: Gregstah

Forum Jump:


Browsing: 1 Guest(s)