![]() The program works properly on the ESP8266 when the pulses are generated by another program on the Atmega 328 but it does not work properly when the pulses are generated by the QRE1113 attached to the small motor. I have only tried a program using interrupts - essentially identical programs on the ESP8266 and on the Atmega 328. It works on the ESP8266 without using interrupts but not when using interrupts you say? One thought is to feed the QRE1113 output into a Schmidt trigger, or an OpAmp - but I don't want a solution that requires extra parts as I don't have space for them and I don't have the ability to use small SMD components. But I cannot think what it might be, how to test for it, or how to improve things. ![]() The only difference between the output from the QRE1113 and the Atmega 328 is that the transitions with the Atmega 328 are much sharper - almost instantaneous.įrom all of this I reckon there is something about the QRE1113 behaviour that is at the margin of what is acceptable to the ESP8266. When I look at the output of the QRE1113 with my oscilloscope it is producing a very clean HIGH and LOW at a very consistent interval (motor running at constant speed). ![]() I wrote a short program for the Atmega 328 so it could output pulses equivalent to what come from the QRE1113 and the ESP8266 detected them with rock solid reliability and accuracy (i.e it was registering the same intervals as the Atmega 328 was generating). It is wired like this (same as this Sparkfun circuit, but I am not just using their breakout board). The QRE1113 is detecting a white spot on a disk rotating on the shaft of a small motor to measure the speed. I wonder if anyone has any ideas about why my QRE1113 reflective optical sensor reliably triggers interrupts to detect pulses when connected to an Atmega 328 (3v, 8MHz) but not when connected to an ESP8266 running virtually the same program. The ESP8266 is marginally smaller and requires a lot less connections because the MCU and the wireless are all in one package. I am exploring the possibility of using an ESP8266 in place of an Attiny1634 and nRF24L01+ for my model train controller.
0 Comments
Leave a Reply. |