{"id":3309,"date":"2023-01-07T06:17:32","date_gmt":"2023-01-07T14:17:32","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3309"},"modified":"2023-01-07T06:17:32","modified_gmt":"2023-01-07T14:17:32","slug":"project-26-radio-frequency-moteino-send-mk01","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3309","title":{"rendered":"Project #26 &#8211; Radio Frequency &#8211; Moteino Send &#8211; Mk01"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3309-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #RadioFrequency #Moteino #Send #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04a.png\" alt=\"Moteino Send\" width=\"720\" height=\"420\" class=\"alignnone size-full wp-image-3311\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04a-300x175.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04b.png\" alt=\"Moteino Send\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3312\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04c.png\" alt=\"Moteino Send\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3313\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/01\/DL2211Mk04c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Radio Frequency<\/strong><\/p>\n<p>Radio Frequency (RF) is the oscillation rate of an alternating electric current or voltage or of a magnetic, electric or electromagnetic field or mechanical system in the frequency range from around 20 kHz to around 300 GHz. This is roughly between the upper limit of audio frequencies and the lower limit of infrared frequencies, these are the frequencies at which energy from an oscillating current can radiate off a conductor into space as radio waves. Different sources specify different upper and lower bounds for the frequency range. Energy from RF currents in conductors can radiate into space as radio waves. This is the basis of radio technology.<\/p>\n<p><strong>Duplex Telecommunications<\/strong><\/p>\n<p>A duplex communication system is a point-to-point system composed of two or more connected parties or devices that can communicate with one another in both directions. Duplex systems are employed in many communications networks, either to allow for simultaneous communication in both directions between two connected parties or to provide a reverse path for the monitoring and remote adjustment of equipment in the field. There are two types of duplex communication systems: full-duplex (FDX) and half-duplex (HDX).<\/p>\n<p><strong>ISM Radio Band<\/strong><\/p>\n<p>The ISM radio bands are portions of the radio spectrum reserved internationally for industrial, scientific and medical (ISM) purposes, excluding applications in telecommunications. Examples of applications for the use of radio frequency (RF) energy in these bands include radio-frequency process heating, microwave ovens, and medical diathermy machines. The powerful emissions of these devices can create electromagnetic interference and disrupt radio communication using the same frequency, so these devices are limited to certain bands of frequencies. In general, communications equipment operating in ISM bands must tolerate any interference generated by ISM applications, and users have no regulatory protection from ISM device operation in these bands.<\/p>\n<p><strong>RFM12B Universal ISM Band FSK Transceiver<\/strong><\/p>\n<p>Hoperf is RFM12B is a single chip, low power, multi-channel FSK transceiver designed for use in applications requiring FCC or ETSI conformance for unlicensed use in the 433, 868 and 915 MHz bands. The RFM12B transceiver is a part of Hoperf EZRadio product line, which produces a flexible, low cost, and highly integrated solution that does not require production alignments. All required RF functions are integrated. Only an external crystal and bypass filtering are needed for operation.<\/p>\n<p><strong>Moteino<\/strong><\/p>\n<p>Moteino began as a low power wireless Arduino compatible development platform based on the popular ATmega328p chip used in the Arduino UNO. Moteinos are compatible and can communicate with any other Arduino or development platform that uses the popular HopeRF RFM69 or LoRa transceivers, or even the older RFM12B. Moteino also comes with an optional SPI flash memory chip for wireless programming, or data logging. Moteino was designed to be a compact, highly customizable and affordable development platform, suitable for IoT, home automation and long range wireless projects.<\/p>\n<p><strong>Moteino R2 (RFM12B)<\/strong><\/p>\n<ul>\n<li><strong>Frequency Band:<\/strong> 433 MHz<\/li>\n<li><strong>Flash Memory:<\/strong> With 4Mbit Flash Chip<\/li>\n<\/ul>\n<p><strong>DL2211Mk04<\/strong><\/p>\n<p>1 x Moteino R2 (RFM12B)<br \/>\n1 x SparkFun FTDI Basic Breakout &#8211; 5V<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Moteino R2<\/strong><\/p>\n<p>TR0 &#8211; Digital 2<br \/>\nLED &#8211; Digital 9<br \/>\nTR1 &#8211; Digital 10<br \/>\nTR2 &#8211; Digital 11<br \/>\nTR3 &#8211; Digital 12<br \/>\nTR4 &#8211; Digital 13<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2211Mk04p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #26 - Radio Frequency - Moteino Send - Mk01\r\n26-01\r\nDL2211Mk04p.ino\r\n1 x Moteino R2 (RFM12B)\r\n1 x SparkFun FTDI Basic Breakout - 5V\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ RFM12B Radio\r\n#include &lt;RFM12B.h&gt;\r\n\/\/ Sleep\r\n#include &lt;avr\/sleep.h&gt;\r\n\r\n\/\/ You will need to initialize the radio by telling it what ID\r\n\/\/ it has and what network it&#039;s on\r\n\/\/ The NodeID takes values from 1-127, 0 is reserved for sending \r\n\/\/ broadcast messages (send to all nodes)\r\n\/\/ The Network ID takes values from 0-255\r\n\/\/ By default the SPI-SS line used is D10 on Atmega328. \r\n\/\/ You can change it by calling .SetCS(pin) where pin can be {8,9,10}\r\n\/\/ Network ID used for this unit\r\n#define NODEID        2\r\n\/\/ The network ID we are on\r\n#define NETWORKID    99\r\n\/\/ The node ID we&#039;re sending to\r\n#define GATEWAYID     1\r\n\/\/ # of ms to wait for an ack\r\n#define ACK_TIME     50\r\n\/\/ Serial\r\n#define SERIAL_BAUD  115200\r\n\r\n\/\/ Encryption is OPTIONAL\r\n\/\/ to enable encryption you will need to:\r\n\/\/ - provide a 16-byte encryption KEY (same on all nodes that talk encrypted)\r\n\/\/ - to call .Encrypt(KEY) to start encrypting\r\n\/\/ - to stop encrypting call .Encrypt(NULL)\r\nuint8_t KEY[] = &quot;ABCDABCDABCDABCD&quot;;\r\n\r\n\/\/ Wait this many ms between sending packets\r\nint interPacketDelay = 1000;\r\n\/\/ Input\r\nchar input = 0;\r\n\r\n\/\/ Need an instance of the RFM12B Radio Module\r\nRFM12B radio;\r\n\/\/ Send Size\r\nbyte sendSize = 0;\r\n\/\/ Payload\r\nchar payload[] = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&amp;*(){}[]`|&lt;&gt;?+=:;,.&quot;;\r\n\/\/ Request ACK\r\nbool requestACK = false;\r\n\r\n\/\/ LED\r\nint iLED = 9;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;26-01&quot;;\r\n\r\nvoid loop()\r\n{\r\n\r\n  \/\/ is RFM12B Radio\r\n  isRFM12BRadio();\r\n\r\n  \/\/ Inter Packet Delay\r\n  delay(interPacketDelay);\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRFM12BRadio.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ RFM12B Radio\r\nvoid isSetupRFM12BRadio(){\r\n\r\n  \/\/ RFM12B Radio\r\n  radio.Initialize(NODEID, RF12_433MHZ, NETWORKID);\r\n  \/\/ Encryption\r\n  radio.Encrypt(KEY);\r\n  \/\/ Sleep right away to save power\r\n  radio.Sleep();\r\n  \/\/ Transmitting\r\n  Serial.println(&quot;Transmitting...\\n\\n&quot;);\r\n  \r\n}\r\n\/\/ is RFM12 BRadio\r\nvoid isRFM12BRadio(){\r\n\r\n  \/\/ Serial input of [0-9] will change the transmit delay between 100-1000ms\r\n  if (Serial.available() &gt; 0)\r\n  {\r\n    \r\n    \/\/ Input\r\n    input = Serial.read();\r\n    \/\/ [1..9] = {100..900}ms; [0]=1000ms\r\n    if (input &gt;= 48 &amp;&amp; input &lt;= 57) \r\n    {\r\n      \r\n      \/\/ Inter Packet Delay\r\n      interPacketDelay = 100 * (input-48);\r\n      \r\n      if (interPacketDelay == 0) interPacketDelay = 1000;\r\n      \r\n      Serial.print(&quot;\\nChanging delay to &quot;);\r\n      Serial.print(interPacketDelay);\r\n      Serial.println(&quot;ms\\n&quot;);\r\n      \r\n    }\r\n    \r\n  }\r\n\r\n  \/\/ Serial\r\n  Serial.print(&quot;Sending[&quot;);\r\n  Serial.print(sendSize+1);\r\n  Serial.print(&quot;]:&quot;);\r\n  \r\n  for(byte i = 0; i &lt; sendSize+1; i++)\r\n    Serial.print((char)payload[i]);\r\n  \r\n  \/\/ Request ACK every 3rd xmission\r\n  requestACK = !(sendSize % 3); \r\n  \r\n  \/\/ Wakeup\r\n  radio.Wakeup();\r\n  \r\n  \/\/ Turn the LED on HIGH\r\n  digitalWrite( iLED , HIGH);\r\n  \r\n  \/\/ Send\r\n  radio.Send(GATEWAYID, payload, sendSize+1, requestACK);\r\n\r\n  \/\/ Request ACK\r\n  if (requestACK)\r\n  {\r\n    \r\n    Serial.print(&quot; - waiting for ACK...&quot;);\r\n    if (waitForAck()) Serial.print(&quot;ok!&quot;);\r\n    else Serial.print(&quot;nothing...&quot;);\r\n    \r\n  }\r\n\r\n  \/\/ Turn the LED on LOW\r\n  digitalWrite( iLED , LOW);\r\n\r\n  \/\/ Sleep\r\n  radio.Sleep();\r\n  \r\n  \/\/ Send Size\r\n  sendSize = (sendSize + 1) % 88;\r\n  \r\n  \/\/ Serial\r\n  Serial.println();\r\n  \r\n}\r\n\/\/ Wait a few milliseconds for proper ACK, return true if received\r\nstatic bool waitForAck(){\r\n  \r\n  \/\/ Now\r\n  long now = millis();\r\n\r\n  \/\/ ACK\r\n  while (millis() - now &lt;= ACK_TIME){\r\n    \r\n\r\n    if (radio.ACKReceived(GATEWAYID)){\r\n      \r\n      return true;\r\n\r\n    }\r\n\r\n  }\r\n  \r\n  return false;\r\n  \r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup(){\r\n\r\n  \/\/ Serial\r\n  Serial.begin(SERIAL_BAUD);\r\n\r\n  \/\/ LED\r\n  pinMode( iLED , OUTPUT);\r\n\r\n  \/\/ RFM12B Radio\r\n  isSetupRFM12BRadio();\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>RTOS<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor, E-Mentor, STEAM, and Arts-Based Training<\/strong><\/p>\n<ul>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2023<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #RadioFrequency #Moteino #Send #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Radio Frequency Radio Frequency (RF) is the oscillation rate of an alternating electric current or voltage or of a magnetic, electric or electromagnetic field or mechanical system in the frequency range from around 20 kHz to around 300 &#8230; <a title=\"Project #26 &#8211; Radio Frequency &#8211; Moteino Send &#8211; Mk01\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3309\" aria-label=\"Read more about Project #26 &#8211; Radio Frequency &#8211; Moteino Send &#8211; Mk01\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,50,49,38,59,5,261,58,10],"tags":[6,102,4,19,85,24,263,262,9,27,264,33,34],"class_list":["post-3309","post","type-post","status-publish","format-standard","hentry","category-radio-frequency","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-moteino","category-arduino-programming","category-projects","tag-arduino","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-moteino","tag-moteino-send","tag-programming","tag-projects-2","tag-radio-frequency","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3309"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3309\/revisions"}],"predecessor-version":[{"id":4005,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3309\/revisions\/4005"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}