{"id":1468,"date":"2014-09-28T15:13:40","date_gmt":"2014-09-28T13:13:40","guid":{"rendered":"http:\/\/labalec.fr\/erwan\/?p=1468"},"modified":"2014-09-28T16:30:22","modified_gmt":"2014-09-28T14:30:22","slug":"sdr-as-in-software-defined-radio-part-3","status":"publish","type":"post","link":"https:\/\/labalec.fr\/erwan\/?p=1468","title":{"rendered":"SDR as in Software Defined Radio : part 3"},"content":{"rendered":"<p>In previous <a href=\"https:\/\/labalec.fr\/erwan\/?p=1457\" target=\"_blank\">article<\/a>, we managed to decode a RF433 packet using homeeasy protocol (a di-o chacon telco for a power outlet).<\/p>\n<p>Next obvious step is now to replay it using our Arduino and a FS1000a rf433 chip.<\/p>\n<p>Here below the arduino sketch.<br \/>\n(wiring is simple : data to digital 3, gnd to gnd, vcc to 3.3v)<\/p>\n<pre>\r\nconst int transmit_pin = 3;\r\n\r\nvoid setup()\r\n{\r\n   pinMode(transmit_pin, OUTPUT);\r\n    Serial.begin(115200);\t\/\/ Debugging only\r\n    Serial.println(\"setup\");\r\n}\r\n\r\nvoid loop()\r\n{\r\n  \/\/time to adjust\r\n  digitalWrite(transmit_pin, LOW);\r\n  delayMicroseconds(5000);\r\n  \/\/preamble\r\n  digitalWrite(transmit_pin, HIGH);\r\n  delayMicroseconds(275);\r\n  digitalWrite(transmit_pin, LOW);\r\n  delayMicroseconds(2800);\r\n  \/\/datas - a manchester encoded string, sniffed with sdrsharp\r\nchar binary[]={0,1,0,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,1,0,1,0,1,0,0,1,1,0,1,0,1,0,1,0,1,0,0,1,0,1,1,0,0,1,0,1,0,1,0,1};\r\nfor (int i=0; i <64; i++){\r\n      if (binary[i]==0) {\r\n        digitalWrite(transmit_pin, HIGH);\r\n        delayMicroseconds(275);\r\n        digitalWrite(transmit_pin, LOW);\r\n        delayMicroseconds(275);\r\n      }\r\n      if (binary[i]==1) {\r\n        digitalWrite(transmit_pin, HIGH);\r\n        delayMicroseconds(275);\r\n        digitalWrite(transmit_pin, LOW);\r\n        delayMicroseconds(1225);\r\n      }\r\n   } \r\n   \/\/the end\r\n   digitalWrite(transmit_pin, HIGH);\r\n   delayMicroseconds(275);\r\n   digitalWrite(transmit_pin, LOW);\r\n  delayMicroseconds(5000);\r\n  \/\/\r\ndelay(1000);      \r\n  }\r\n<\/pre>\n<p>Here below the generated signal which as you can see is very similar to the original one.<\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_arduino.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_arduino-300x108.png\" alt=\"rf433_arduino\" width=\"300\" height=\"108\" class=\"alignnone size-medium wp-image-1473\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_arduino-300x108.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_arduino-1024x369.png 1024w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_arduino.png 1260w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The original<\/p>\n<p><a href=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_Audacity2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_Audacity2-300x108.png\" alt=\"rf433_Audacity2\" width=\"300\" height=\"108\" class=\"alignnone size-medium wp-image-1454\" srcset=\"https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_Audacity2-300x108.png 300w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_Audacity2-1024x369.png 1024w, https:\/\/labalec.fr\/erwan\/wp-content\/uploads\/2014\/09\/rf433_Audacity2.png 1260w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In previous article, we managed to decode a RF433 packet using homeeasy protocol (a di-o chacon telco for a power outlet). Next obvious step is now to replay it using our Arduino and a FS1000a rf433 chip. Here below the arduino sketch. (wiring is simple : data to digital 3, gnd to gnd, vcc to <a href='https:\/\/labalec.fr\/erwan\/?p=1468' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[65],"class_list":["post-1468","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-homeeasy","category-18-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1468"}],"version-history":[{"count":6,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1468\/revisions"}],"predecessor-version":[{"id":1477,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=\/wp\/v2\/posts\/1468\/revisions\/1477"}],"wp:attachment":[{"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labalec.fr\/erwan\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}