GPIO output (for RF transmitter)

Discussion in 'UDOO X86' started by compi150, May 17, 2017.

  1. compi150

    compi150 New Member

    Joined:
    May 17, 2017
    Messages:
    5
    Likes Received:
    1
    Hey there,
    just received my udoo x86 and got a few things up and running with should replace my bananapi in the future.
    But I'm not quite sure, if this next step is possible...

    On my bPi, i've connected a 433Mhz transmitter ( https://www.sparkfun.com/products/10534 ) and installed wiringPi for sending signals.

    Do you think, that this is possible to adapt on an udoo x86? Do I have to use the arduino-parts or can I directly control the GPIO Pins, like in wiringPi? In my case it's GPIO17.
    Thank you for your answers :)

    My current setup:
    Debian Stretch with a LAN --> WiFi-bridge using hostapd and bridge-utils
     
    Last edited: May 17, 2017
  2. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    It doesn't look like you can just plug this transmitter right into any Arduino, to me it looks like it would just claim four random pins. You can use male-female Dupont wires to wire the pins to the Arduino.

    [​IMG]
     
  3. compi150

    compi150 New Member

    Joined:
    May 17, 2017
    Messages:
    5
    Likes Received:
    1
    Thank you for the reply. :) I already own these wires - can try it later.
    Is it possible to use the GPIO17, which is mentioned here https://www.udoo.org/docs-x86/img/x86_pinout_arduino.png ?
    My planned cabling is: +5V, Ground and GPIO17 like it was on my bPi. But not sure, if it works...
     
  4. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    92
    According to datasheet it can work with 3-12V VCC. Since Arduino 101 used in UDOO X86 uses 3.3 V signals, it might be best to use 3.3 V as VCC instead of 5V.
     
  5. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    92
    Also note that INNER pins like shown in your image are controlled by Arduino. These have 3.3 signal voltage (but can be safely used with 5 V input signals).

    OUTER pins are then controlled directly by main CPU but they use 1.8V so are not compatible with your transmitter.

    So it seems that you have to either use Arduino pins, or if you want to use direct pins then you would need voltage level translation in between.
     
  6. compi150

    compi150 New Member

    Joined:
    May 17, 2017
    Messages:
    5
    Likes Received:
    1
    @Markus Laire Thank you for the advice! So it's okay to use the GPIO17? I'm pretty interested in trying wiringPi commands, like "send" for switching remote power plugs via the udoo.

    But this was on my bananapi, so I don't think, that this will work... But I'll give it a try. I expect, that either the compiling or the using of wiringPi https://git.drogon.net/?p=wiringPi;a=summary will fail...
     
    Last edited: May 17, 2017
  7. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    92
    GPIO17 (or any other) should work as long as the Arduino library you use supports that.

    You could try to create an Arduino sketch which takes inputs from UDOO via serial and then relays them to transmitter.
     
  8. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    Ok, couple things here...

    1) Talking to the Arduino pins is somewhat different than talking to the GPIO pins on a Ras/Banana Pi. You can't directly do it via Python or WiringPi.
    2) Talking to the GPIO pins controlled by the CPU is more in line with what you were doing on the Pi, but you have to deal with the voltage levels being significantly different, and you need some sort of API to talk to (which I don't know about for the CPU... )
     
    waltervl likes this.
  9. compi150

    compi150 New Member

    Joined:
    May 17, 2017
    Messages:
    5
    Likes Received:
    1
    Hi all,
    thank you very much for your help! :)
    I got it working rudimentally. Here's what I've done (after installing Arduino IDE 1.8.2 and the Arduino 101 board definitions):
    - Cabling: 3.3v, Ground and Pin4 (The left ones, including GPIO17 are analogue in and might not work properly)
    - Installed the rc-switch library via the Arduino IDE library manager (Ignore the warning, that it's not compatible with the Arduino 101)
    - Written the code - more or less by myself (had some really good help from my girlfriend)

    Here's "my" code - which isn't perfect. Having some trouble when sending 2 commands with a too short waiting time. Have to reboot for getting it back working.

    Code:
    #include <RCSwitch.h>
    
    RCSwitch mySwitch = RCSwitch();
    char code;
    void setup() {
      mySwitch.enableTransmit(4);
      Serial.begin(9600);
      delay(1000);
      }
    
    void loop()
    {
      while(Serial.available() <= 0){ delay(10);}
      code = Serial.read();
      if (sizeof(code) == 1)
      {
        switch(code)
        {
          case '0' :
          mySwitch.switchOn("11111", "01000");
          break;
          case '1':
          mySwitch.switchOff("11111", "01000");
          break;
          case '2':
          mySwitch.switchOn("11111", "00010");
          break;
          case '3':
          mySwitch.switchOff("11111", "00010");
          break;
          default:
          break;
        }
      }
    }
    Now the commands can be executed by sending the numbers to the ttACM0, for example:
    Code:
    echo '1' > /dev/ttyACM0
     
    Last edited: May 18, 2017
    waltervl likes this.
  10. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    compi150 likes this.
  11. compi150

    compi150 New Member

    Joined:
    May 17, 2017
    Messages:
    5
    Likes Received:
    1
  12. Maurice

    Maurice Active Member

    Joined:
    Oct 13, 2015
    Messages:
    394
    Likes Received:
    87
    I went straight for the transceivers, as they have both a transmitter and a receiver. In my home project I'll switch to XBee (ZigBee). In my opinion WiFi is too unreliable.

    [​IMG]
     
  13. YellowGTM

    YellowGTM Member

    Joined:
    Sep 21, 2017
    Messages:
    56
    Likes Received:
    3
    For the inner pins (ie: pins 0-7) of the x86 101, I'm getting a low reference voltage of 1.2VDC instead of zero.

    Is this correct? Shouldn't the low/ground reference be closer to zero?
     
  14. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    You should check with Arduino 101 (curie) documentation what is the threshold for digital pins.

    In this link someone had the same experience as you on a normal Arduino 101. He measured 1.26V threshold. https://arduino.stackexchange.com/questions/38939/arduino-101-i-o-voltage-levels
     
  15. ccs_hello

    ccs_hello UDOOer

    Joined:
    Apr 15, 2017
    Messages:
    536
    Likes Received:
    194
    Arduino 101's IO pin, when set to output mode, if not driving the heavy load (within the spec), should be 0V on logic 0 and about 3.3V on logic 1.
    In the case of input mode, the voltage level is determined by external signal driving that pin.
     

Share This Page