• AVR Freaks

Hot!New to Wi-Fi

Author
JustRob
Super Member
  • Total Posts : 585
  • Reward points : 0
  • Joined: 2008/09/04 12:49:27
  • Location: Hudson Massachusetts United States
  • Status: online
2020/05/24 06:54:50 (permalink)
0

New to Wi-Fi

I have 10 general purpose io (nothing high frequency) that I'd like to transmit a short distance; I'd say 5 feet.  I found on digikey a cheap transceiver with the datasheet:
https://en.mxchip.com/filedownload/22513
 
I see I can control it via SPI but I don't find anything eluding to how to set up the communication.  If I have my pic, which right now is a pic16lf18345, as the master transmitting side do I need a pic on the receiving board?  I can't find any tutorial on how to configure this device and write the code so I can transmit signals.
 
Thanks

Sometimes the obstacles in our path ARE our path!
 
https://abateandempower.com/
#1

11 Replies Related Threads

    katela
    Super Member
    • Total Posts : 1809
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: online
    Re: New to Wi-Fi 2020/05/24 08:01:21 (permalink)
    0 (2)
    That's the problem with Chinese datasheets, they are very poor in technical details.

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #2
    du00000001
    Just Some Member
    • Total Posts : 3778
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: New to Wi-Fi 2020/05/24 08:09:46 (permalink)
    +1 (1)
    Hi Rob,
     
    a short glimpse into this datasheet revealed:
    • This is some variant of the approach well-known as ESP8266. Thus it has to be programmed.
    • As it must be programmed, you can do "about everything". I assume, it could be used in SPI slave mode as well. Although you might be better off using a UART connection.
    • Programming might be challenging as is seems less well supported than the ESPs. Although the following link might help:   https://www.seeedstudio.com/EMW3060-WiFi-Module-p-2860.html
    I don't know how cheap you can get an ESP8266 module from china, but I could dig up a Wemos D1 (nodemcu 12F) for less than 3 $.
    And development support for that one is just great:
    • Supported by the Arduino IDE.
    • Supported by a huge community.
    • Lots of example projects available. Finding the one closely matching your needs might be the biggest challenge  :)
    P.S.: Seems all these WiFi modules run from 3.3 V. Thus you might need an LDO and a level shifter to connect it to a PIC running from 5 V. (A UART connection could get away with a series resistor or a resistive divider, provided it's unidirectional (PIC TX only).

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #3
    JustRob
    Super Member
    • Total Posts : 585
    • Reward points : 0
    • Joined: 2008/09/04 12:49:27
    • Location: Hudson Massachusetts United States
    • Status: online
    Re: New to Wi-Fi 2020/05/24 09:14:37 (permalink)
    0
    I don't know how cheap you can get an ESP8266 module from china, but I could dig up a Wemos D1 (nodemcu 12F) for less than 3 $.

    Please dig?  I could not find anything on that...
     
    Seems all these WiFi modules run from 3.3 V. Thus you might need an LDO and a level shifter to connect it to a PIC running from 5 V

    All of my designs are 3.3V

    Sometimes the obstacles in our path ARE our path!
     
    https://abateandempower.com/
    #4
    OscarTheGrouch
    Super Member
    • Total Posts : 338
    • Reward points : 0
    • Joined: 2010/11/29 18:07:28
    • Location: 0
    • Status: offline
    Re: New to Wi-Fi 2020/05/24 09:49:58 (permalink)
    0
    JustRob
    I have 10 general purpose io (nothing high frequency) that I'd like to transmit a short distance; I'd say 5 feet.

    Could you explain a little more on what you are trying to accomplish? You mentioned 10 I/Os. Are you trying to transmit the state of those I/O ports? Are you wanting to use those I/O ports as 10 separate transmit signals?
    Why use WiFi? Are you sending this data to a cell phone, computer network?
    If you do not need WiFi but just some sort of short distance RF communication link, you might look into the Wixel from Pololu. I have used it to communicate between a PC and a PIC just using the PICs standard ESUART. Very easy to use.
    https://www.pololu.com/docs/0J46
    OtG
    #5
    JustRob
    Super Member
    • Total Posts : 585
    • Reward points : 0
    • Joined: 2008/09/04 12:49:27
    • Location: Hudson Massachusetts United States
    • Status: online
    Re: New to Wi-Fi 2020/05/24 10:01:00 (permalink)
    +1 (1)
    I want to control (remotely) two stepper motors each having enable, reset, mode, step (clock) and direction signals.
     
    The transmitter will be a circuit board sensing motion in two dimensions. 
     
    The receiver board will be the stepper drivers a distance of 5 feet away and I'd rather not have a cable running between the two circuit boards.

    Sometimes the obstacles in our path ARE our path!
     
    https://abateandempower.com/
    #6
    OscarTheGrouch
    Super Member
    • Total Posts : 338
    • Reward points : 0
    • Joined: 2010/11/29 18:07:28
    • Location: 0
    • Status: offline
    Re: New to Wi-Fi 2020/05/24 12:26:40 (permalink)
    0
    JustRob
    I want to control (remotely) two stepper motors each having enable, reset, mode, step (clock) and direction signals.

    Do you have a design for this? Are you using a PIC and/or Stepper Motor Driver?
    Here is a good selection of drivers from Pololu -> https://www.pololu.com/category/120/stepper-motor-drivers
     
    JustRob
    The transmitter will be a circuit board sensing motion in two dimensions. 

    Again, do you have a design? What will it be transmitting to the "receiver board"? Motion data or stepper motor commands, etc? This will determine how much data you need to send to the "receiver board" which will determine what link system you need. IMO, sounds like a job for the Wixel "Using an RF bit rate of 350 kbps, the serial app is capable of transmitting or receiving up to 10 KB of data per second and can reach a range of approximately 50 feet (under typical conditions indoors), and multiple serial links can be used simultaneously on different channels."
     


    Another approach, if you don't have a design yet, is using a Raspberry Pi single board computer. I used it to build the "CamBot" several years ago based on information in this issue of their magazine -> https://magpi.raspberrypi.org/issues/9/pdf The article was titled "WebIOPi - Raspberry Pi RESTframework". This used WiFi with a Web Server as the robot control. It controlled two stepper motors as well as transmitting back web cam video.
    OtG
    #7
    du00000001
    Just Some Member
    • Total Posts : 3778
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: New to Wi-Fi 2020/05/24 12:45:12 (permalink)
    +1 (1)
    Re digging:
    Let me start with a link to wikipedia: https://en.wikipedia.org/wiki/ESP8266
    Just checked: what I have been working with are "nodemcu with LUA" (this one without a fancy version information), "ESP-12F" and some others I'll have to resurface in one of my archives.
     
    My first search was on ebay - location worldwide, sort price ascending.
    If you search for "ESP 8266" resp. "nodemcu" resp. "ESP-12F" (each without the quotes), a lot of sellers is expected to surface. Best to have a module with integrated USB interface: the better ones won't require you to depress a key to start downloading.
     
    PLUS: assuming that your console might be something similar to the console of your heating/cooling device: you can easily service the touch, display, buttons etc. with the ESP. No need for a separate PIC and controller-controller communications on this side (provided the number of pins on the ESP module suffices).
     
    [edited]
    Dug up another "nodeMCU V3", cannot locate my ESP-based WiFi scanner.
    Just checked aliexpress: they offer a lot of ESP8266 modules, starting at around 2 $ incl. shipping.
    Just enter "nodemcu", sift through the offers and select the module of your choice.
    (Couldn't find an EMW3060 there. Seems, this one is mainly offered by seeedstudio.)
     
    P.S.:
    Most ESP modules use the CH340/CH341 USB converter. This one is (was?) not supported by current Win versions. But it's not too difficult to download and install the corresponding driver.
    post edited by du00000001 - 2020/05/24 13:24:12

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #8
    du00000001
    Just Some Member
    • Total Posts : 3778
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: New to Wi-Fi 2020/05/24 13:30:23 (permalink)
    0
    @ OscarThe...
     
    Don't (yet) know what Rob has in mind.
    Could well be the 2 A maximum phase current of the Pololus will be too meagre.
    He somewhat tends to 2-digit Amps in his applications  :)

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #9
    JustRob
    Super Member
    • Total Posts : 585
    • Reward points : 0
    • Joined: 2008/09/04 12:49:27
    • Location: Hudson Massachusetts United States
    • Status: online
    Re: New to Wi-Fi 2020/05/24 14:46:54 (permalink)
    0
    I do have a design for this.  Currently my micro is the PIC16LF18345.  I have two Nema 17 0.9 degree 1.6A stepper motors that are working very well with two Allegro MicroSystems stepper motor drivers: A3982SLBTR-T
     
    I really only need 8 signals to transmit; the control signals for each stepper driver.  Ultimately this would be an application with a display but currently I am not using any display so I was hoping the communication handshaking would be coded some how.
     
    My motion sensor is a gyro and accelerometer 6 degrees of freedom breakout board spi interface.  I want to monitor the motion of the breakout board and use the steppers with a device mounted to them to follow (track) in two dimensions the motion of the breakout board.

    Sometimes the obstacles in our path ARE our path!
     
    https://abateandempower.com/
    #10
    du00000001
    Just Some Member
    • Total Posts : 3778
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: New to Wi-Fi 2020/05/24 16:21:50 (permalink)
    +1 (1)
    I had considered the use of some some x DOF sensor for your remote, but wasn't sure.
     
    Anyway, this one would easily attach to an ESP (see e.g.  http://www.esp8266learning.com/esp8266-bmi160-sensor-example.php  - seems btw. a great resource wrt ESP8266 solutions ). I'd make the remote the clint, although this is not mandatory. (Maybe just old-fashioned thinking  :) )
     
    The tricky part may be the simple "follow the motion": accelerometers and gyros are prone to noise - resulting in increasing errors over time as you have to integrate the noisy measurement values. Depending on the expected outcome, it might be better to use the sensor as some kind of "joystick": define some thresholds and
    1. Just don't let the motors move if the measured value is between the most inner values.
    2. Move with v1 when the value is within the inner pos./neg. bands.
    3. Move with v2 when the outer boundaries are exceeded.
    Such a scheme might allow for only one (1) motor at a time - at least that's what's currently crossing my mind. Might have to have such a sensor in hand to find out how difficult it might be to simultaneously control 2 axes...
     
    The receiver side would be just another ESP8266 - this one maybe the base station.
    Whether that one directly controls the steppers: up to your decision. (Most stepper drivers happily accept a 3.3 V logic supply these days.)

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #11
    JustRob
    Super Member
    • Total Posts : 585
    • Reward points : 0
    • Joined: 2008/09/04 12:49:27
    • Location: Hudson Massachusetts United States
    • Status: online
    Re: New to Wi-Fi 2020/05/25 06:40:01 (permalink)
    0
    Thanks du00000001!!!
     
    I have a nice 0.9" x 0.9" 6 DOF board in the mail with schematic symbols and a pcb layout that I made yesterday.
     
    I don't want this joystick controlled.  I will PM you the application (wicked way cool) in my humble opinion.
     
    And the ESP8266 module looks to be a perfect solution!

    Sometimes the obstacles in our path ARE our path!
     
    https://abateandempower.com/
    #12
    Jump to:
    © 2020 APG vNext Commercial Version 4.5