Menu

ESP8266 + ULN2003 driver pinout?

2022-02-25
2022-03-02
  • Christopher Gabow

    I've been trying to get my ESP8266 to communicate with my ULN2003 + 28BYJ-48 motor. I am able to use example code to test that the stepper motor and driver are functional, but I can't get the motor to drive at all with the ESP focuser firmware. I have defined the driver board (PRO2EULN2003) and matched the pins to D4, D5, D6, D7 as noted in a schematic photo, but I don't see where that is defined anywhere in the code.

    As it stands, I am able to connect myFP2ESP to the board but sending step commands does nothing to move the motor.

     
  • brownrb

    brownrb - 2022-02-26

    Hi Christopher
    This is the myFP2 forum - you should post on the other site for the wifi
    https://sourceforge.net/projects/myfocuserpro2-esp32/

    I will take the time to answer your queries here. It is a sort of check list for things to check out...

    ULN2003 + 28BYJ-48 motor. I am able to use example code to test that the stepper motor and driver are functional

    Is this using a PCB? or just breadboarded it (uses wire leads to connect the pins from the esp8266 to the driver board.
    If a PCB what version number? 22?
    If so how did you connect the seperate power for the uln2003 driver board?

    For the PCB, you need to power from 12V or the motor will not move.
    You need to set jumper j10 on the PCb to select either a 12V motor or 8V (for the 5v motors)
    For the PCB, with 12V power on to the PCB, and with NO USB cable connected, does the arduino nano light up when the 12V power is on?

    What firmware?
    I am assuming 230-1 downloaded from GitHub?
    https://github.com/brownrb/myFP2ESPFirmware

    Did you successfully reprogram the controller with the firmware release 230-1?
    It uploaded ok?

    Please, I need to see your focuserconfig.h file. If you changed the SSID and PASSWORD fields in that file, then please delete thos lines from the file before sending the file. I assume that you keep a backup copy of the file though)

    Please. do a snap shot (screen grab, cntrl + printscreen) of the arduino IDE tools menu, I attached mine to this reply so you see what I am after.

    Please I need a copy of the following controller files
    board_config.jsn
    data_per.jsn
    pg 136 of PDF
    USING THE MANAGEMENT SERVER: SHOW CONTROLLER CONFIG
    USING THE MANAGEMENT SERVER: SHOW BOARD CONFIG
    again screenshots of browser window, paste into Paint, save as PNG or JPG (ensure the text is big enough for me to read)

    Cheers
    Robert

    but I don't see where that is defined anywhere in the code.

    Board configuration (what pins are what), you do not have to do. This is all managed through board configuration which is automatic and does not require user intervention.

    It is there, by magic, slieght of hand, as the board configuration is built on the first reboot following a firmware upload to the controller, followed by uploading of the data sketch files. A lot of this board auto configure is hidden from the user. It is one piece of magic code that would require a longer explanation. However, if you send me the files etc that I have asked for, I can tell if the board config is correct or something went wrong.

     

    Last edit: brownrb 2022-02-26
    • Christopher Gabow

      Hello, thank you for your response!

      I am running the ULN2003 board on 5v as it a rated to do so (tested with example code from another tutorial) Amazon link: https://www.amazon.com/dp/B01CP18J4A

      I am indeed using the 230-1 firmware and it uploaded without issue once I had all the libraries in the correct folder

      focuserconfig file is attached

      I am able to get the board to connect over wifi but the web server doesn't seem accessible from either my desktop or phone (This site can’t be reached 192.168.4.1 refused to connect.) (access point mode). MyFP2ESP does connect to the board though. Is there another way to find the board_config.jsn, data_per.jsn files?

      I have been able to host another web server from another project so I don't believe there is an issue with the connection.

       
  • brownrb

    brownrb - 2022-02-27

    I cannot do much without the other files.
    You did not say if you were using a PCB or your own board or simply some wires to connect
    This is important to for me to know this

    If you are running as an accesspoint, then you need to connect YOUR COMPUTER to that network first. Or any device like phone or tablet. If you do not, then you will not be able to get to anything.

    See
    https://www.youtube.com/watch?v=o1UVqP6QM2Q
    about 8 minutes in

    It is an old video and things have much improved since then - but shows what needs to happen to connect to a controller in accesspoint mode.

    and this video
    https://www.youtube.com/watch?v=eWjKfe6tBCc

    The webserver is in a disabled state. What you need to do is first access the management server, then enable the web server there.

    The management server runs on port 6060
    So open a web browser to
    192.168.4.1:6060
    first, which displays the admin interface, then enable the webserver

     

    Last edit: brownrb 2022-02-27
    • Christopher Gabow

      Hi,

      I am not using any custom PCB. I am attempting to use both anESP8266 OR ESP32, whichever I can get working.

      Currently I have switched to an ESP32 with the IN1-4 pins wired to D14,D27,D26,D25 and I have managed to get the management server up and running. The board does not light up at all and will not respond to commands

      board_config : {"board":"PRO2ESP32ULN2003","maxstepmode":2,"stepmode":1,"sda":21,"sck":22,"enpin":-1,"steppin":-1,"dirpin":-1,"temppin":13,"hpswpin":4,"inledpin":18,"outledpin":19,"pb1pin":34,"pb2pin":35,"irpin":15,"brdnum":45,"stepsrev":2048,"fixedsmode":-1,"brdpins":[25,27,14,26],"msdelay":8000}

      data_per.jsn :
      {"maxstep":80000,"stepsize":50,"delayaftermove":0,"backlashsteps_in":0,"backlashsteps_out":0,"backlash_in_enabled":1,"backlash_out_enabled":1,"tempcoefficient":0,"tempresolution":10,"coilpwr":0,"cptimeout":120000,"rdirection":0,"stepsizestate":0,"tempmode":1,"oledupdateonmove":1,"oledpagetime":2,"tempcompstate":0,"tcdir":0,"motorspeed":2,"displaystate":1,"preset":[0,0,0,0,0,0,0,0,0,0],"wsport":80,"ascomport":4040,"mdnsport":7070,"wprefreshrate":60,"tcpipport":2020,"startscrn":1,"bcol":"333333","tcol":"5d6d7e","hcol":"3399ff","ticol":"8e44ad","ason":0,"wson":1,"tprobe":0,"leds":0,"hpswmsg":0,"fcdownld":0,"oledpg":7,"mspeed":2,"hpswen":0,"pbenable":0,"stallguard":100,"tmc2225mA":300,"tmc2209mA":600}

       

      Last edit: Christopher Gabow 2022-02-28
    • Christopher Gabow

       

      Last edit: Christopher Gabow 2022-02-28
  • brownrb

    brownrb - 2022-03-01

    Hi Christopher
    The files look ok.
    The ESP32 is the better choice, ESP8266 is not a good choice * Currently I have switched to an ESP32 with the IN1-4 pins wired to D14,D27,D26,D25 and I have managed to get the management server up and running. The board does not light up at all and will not respond to commands*

    Which board does not light up? The ULN2003 board?
    Have you got power to the driver board?
    attached

     
    • Christopher Gabow

      None of the LEDs illuminate on the ULN driver board and I have tested with a multimeter and ensured that the board is receiving 5v power. I believe it must be something with the pinouts or how it was defined.

      Update: I went back to the ESP8266 for testing and was able to get it to drive the stepper although it seems much rougher than I thought it would be. Two LEDs light up in an alternating pattern, could this be a resolution thing?

       

      Last edit: Christopher Gabow 2022-03-01
  • brownrb

    brownrb - 2022-03-02

    I doubt it.
    generally speaking, a uln2003 board with a 28BYJ-48 motor is relatively simple, 4 inputs, power and then 5 outputs to the 28byj48 motor.

    If the stepping is rough, it probably indicates a wiring issue between the arduino/esp and the 4 inputs of the uln2003 driver board.

    It the motor moves only in one direction, or jumps about oscillating between one direction and the other, again that is a wiring issue. This is easily tested by moving the motor in and out using the windows app or the web server interface

    I have looked at the video you posted. I can clearly see all lights on, but some are pulsed at a shorter duration than the other two. If you view the video at a slower speed this is clear.

    What program are you using to driver the stepper?

    In the ,myfp2esp firmware, there is a test folder and a test program calledULN2003-MINIMAL-BRDDRV
    did that work?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.