Hi
[References to the components I used are listed below]
I built a curtain opener using a 2.4A motor, a TB6560 controller and an Arduino Nano. It works perfectly. Now I decided to redo the project using a nodemcu v1 module (please don't ask me to change it because i have a lot). The problem is the nano is 5V and the nodemcu is 3.3v, so naturally I decided to use a logic level shifter [see below]. With no load, the output from the nodemcu is converted to 5V nicely. When I put a load (in this case my motor controller) it doesn't work (though at one point it did).
After doing multiple tests I realized that even when I put a full size LED with no resistors, it doesn't light up. If i put a mini LED with a 330ohm resistor it lights up. I checked the output voltage and I found that it is 2.73. When I remove the LED and measure I get 4.46V. A difference of 1.73V
Looking at the specs below I see that the output current from the nodemcu is 12mA whereas the nano (which can drive the motor with no issues), is 40mA if I remember correctly.
Furthermore, sometimes with the voltage level shifter connected, when I turn on the nodemcu, I get garbage in the output window. I have to remove it and then power up and then add it.
I use one of those power supplies with a 12V 2A adapter. Power Supply
Now my question is, does this mean the nodemcu output current is too low to drive the devices? What can I do to increase the current?
I think most TB5650 modules have opto coupler inputs.
Can't use a level shifter with that.
Post a link to the TB6560 module you have.
It should work if you connect V+ to 3.3volt (of the NodeMCU), and Pol-, DIR-, EN- directly to the ESP outputs.
Be careful which outputs of the NodeMCU you're using. Most have double functions.
Note that a breadboard supply uses common linear voltage regulators.
If it has to drop (12-5=) 7volt, then it can only supply ~100mA before overheating (a 2Amp supply is overkill).
Just about what the NodeMCU is drawing.
A switching buck converter would be a better (less heat) option.
Leo..
Please see attached. The 2A adapter is the only one I have for now. That is why I used it, otherwise I would use 1A or so. I assume regardless of the adapter the bottleneck would be the breadboard power supply.
I've already tried wiring it directly to the nodemcu, but it never really worked. It might accidentally work once or twice, but never consistent. Actually at the moment, the most obvious problem is the direction pin. The motor would always spin in the same direction. I thought the controller board was defective, but when i manually connect it to +5V, the motor goes in the other direction, so I am almost sure it is a voltage issue which is obvious from the drop that happens when I put a load.
I am thinking the issue of connecting the motor driver directly to the nodemcu is the current is not enough to drive it. Am I wrong? Otherwise why does it not work when I connect it directly. On a separate, but similar issue I have another nodemcu that would freeze on startup when I have data output taken for an I2C LCD screen (the screen is powered by 5V from the other side of the dual voltage power supply)
If... you power the NodeMCU through the USB socket with a 5volt cellphone charger,
then there will be ~4.3volt on it's 5volt pin.
You can use that ~4.3volt to safely power the V+ pin of the motor driver,
because the IR LEDs drops ~1.2volt, so the MCU pin never sees more than ~3.1volt.
Don't do this with the breadboard supply.
Remember what I told you about the double functions of the NodeMCU pins.
The wrong pins can give you all sorts of trouble. Not sure which ones you can safely use.
Maybe someone else can chime in for those pin numbers.
Leo..
sed003:
Looking at the specs below I see that the output current from the nodemcu is 12mA whereas the nano (which can drive the motor with no issues), is 40mA if I remember correctly.
That 40 mA is the absolute maximum of the pin, and a bad idea to draw that much (the output voltage also drops quite drastically if you do). 20 mA is the safe maximum.
12 mA for the ESP8266 sounds about right. That's more than enough to drive an LED, or an optocoupler for that matter.
No idea what you mean with "full size LED". A regular LED will not last long if connected to an Arduino output pin without resistor, it'll burn. Maybe yours burnt already? Maybe you connect it the wrong way around? Test it with your multimeter!
Revisiting this issue, the current output from the pin is 3V. I need it to be 3.2. How can I achieve that? I tried to add a 10k pullup resistor, but I still get only 3V
Actually I would prefer 3.3V. It is just that when I measured the voltage from the power supply it was 3.2V.
The output I measured from the pin was 3V and that does not seem high enough for the motor controller board to switch direction, so no matter what the output is, it is always rotating in the same direction. I made 3 boards and when it comes to whether the direction works properly seems a bit random. If I wire the pin directly to the 3.3V power supply it always works.
Completely inappropriate choice of "level shifter"; this one is only for interfacing bidirectional I2C lines.
If you want to convert 3.3 V levels to 5 V levels for something other than a 74HC device or ATmega, then you use two cascaded inverters of a 74HCT14 or failing that, a 74HC04 will generally do.
For shifting down from 5 V to 3.3 V for an ESP, you use a diode with cathode to the 5 V logic and enable INPUT_PULLUP on the ESP. Mount the diode close to the ESP.
There are also buffer chips like the 74xx244 and 74xx245 which don't invert, useful if you have a lot of signals to shift in level as these chips have 8 channels each.
From 3.3V to 5V you can use 74HCT logic family, powered at 5V,
From 5V to 3.3V you can use 74LVC logic family, powered at 3.3V as they are 5V tolerant on the inputs.
Hello all,
Thanks for your responses. The manual for the TB6560 says the "Level of input pulse is 5V", so yes this is what I am finding. The put levels from the nodemcu is border line that is why it sometimes works and sometimes doesn't. A similar circuit that I have had for two years have been working fine with an arduino nano.
So you all agree I need a different type level shifter, can you recommend a specific one? I believe based on your recommendations I am looking for a 74HCT
If so I understand that if I had 3 outputs to convert (generally speaking, i know here i only need 2), then I would use
1A for first input, 1Y for first output
2A for second input, 2Y for second output
3A for third input, 3Y for third output
Obviously I don't need the B side because I am not doing any OR operations.
That's a NOR gate, should work. Note that it inverts the output, so you have to invert your logic as well in code. Or cascade two gates.
I'd link the A and B inputs together, easiest. You shouldn't leave any input unconnected anyway, or its state is undefined - that accounts also for unused gates. Always connect those inputs to GND or Vcc.
As it's just 3.3V to 5V shifting, you can also use an npn transistor and some resistors. Also inverting of course.
Hello all,
I am happy to tell you the chip resolved my issue. Now the rotation direction is always guaranteed.
I was hoping to use the other logic level shifter with the I2C, but that's probably another issue. The nodemcu mostly freezes on boot (especially, but not always when the LCD is connected). The logic level shifter does not do anything. I have yet to find use for it.
While I still have your attention, i have another question: I noticed that the power supply board gets hot. This is not the case with my arduino nano circuit. It is powered by a 1A 12V adapter and I am obviously using one nodemcu, 74HCT08, 2 LEDs, 2 x 5V proximity detectors (using the same detectors on my nano) and of course the motor driver board. Similar configuration with nano, but the power supply board doesn't have any heat with the nano. I have it powered up all the time. What could it be?