Hardware Woe

I have been looking for a 5V ready ESP8266 board, so following Luiz Gabrie’s link, I bought this board. I was happy to find that it has 4M bytes flash.

 

5Vesp8266

It might be its level shifting circuit, I can’t flash it under Arduino IDE, via a USB-Serial adapter of course, but I made it by directly invoking the esptool.py. However, I soon found that the receiving of this module seems to have some problems. It didn’t receive data from the Arduino. Neither with my working horse, nor my test platform. It’s strange because it can be flashed so it should has a working serial. I then tried the baud rate of fishing, 115200. It did work with my test platform but still failed with my working platform.

I am tired of it, totally. I decide to kiss goodbye Arduino, like what I have already done with BrewPi.

BrewManiacAtESP8266

 

 

11 thoughts on “Hardware Woe

  1. Too bad that you couldn’t get it to work. I bought a Wemos D1 mini v2, which i will try with. But will use resistor divider soldered on a daughter-board/shield. I’ll let you know as soon as it is tested. Otherwise it would be great to make a new shield for the ESP8266 12E to replace the arduino shield.

  2. Is it possible to run the full software on the ESP8266 ?

    I had a play today and got the Arduino software building on a ESP8266, but now need to merge the Wifi / Web software into the same sketch. Will have a go tomorrow.

    If you couple a single ESP with a 124×64 OLED display, you could have the smallest, cheapest brew controller ever … count me in :-).

    It would actually fit into a STC-1000 controller enclosure, also using the buttons … neat solution.

  3. Have you seen the last photo of this post?
    I already put all software together and tested the keypad and 20×4 I2C LCD. It seems to work fine.
    The seller of my PCF8574 board sent a wrong board, so I have to wait for another week.
    Theoretically, the PCF8574 will work with the LCD and can be used to control heater, pump, and buzzer. I might also connect the keypad to PCF8574 if possible.
    The ideal setup should have pull-ups for keypad/buttons and transistors for driving circuit for pump, heater, and buzzer control, but I will try without them.
    To build a smaller system, the D1 mini board is a better solution. Combining the pull-ups, driving circuit and PCF8574 to build a shield might be better.

    The biggest component will be the heat sink of SSR, which might not fit in that small space. The power supply might also takes some space. I thought about a 200x12x75mm project box but find it a tight fit. Considering EMI, which I have suffered for a while, a bigger box might be better if some kind of isolation is necessary. (Other way to alleviate EMI is to use SSR to control PUMP instead of a RELAY, which I planed to use.)

  4. Ahh – got it. I didn’t read your post carefully enough.

    Great work .. have you put your combined code up on GitHub, I’d really like to take a look at it. I’m playing with a I2C 124×64 OLED display – cheap, small form factor and maybe a little more flexible (graphics) than the 20 x 4.

    I don’t understand your use of a PCF8574 – thats an I/O expander – right ? Is there not enough pins on the ESP / D1 mini board ?

  5. Smaller isn’t always better. I prefer bigger display in this case.

    We will need 10 IOs PINs.
    4x buttons
    1x OneWire sensor
    3x pump, heater, buzzer,
    2x I2C.

    According to this page, ESP8266 11 GPIOs available, but two of them are for UART. Eliminating serial debugging makes debugging difficult. Moreover, GPIO0, 2 and 15 must be kept high and low to enable normal boot up. Taking that into consideration, additional PIN might be better.

    http://blog.falafel.com/programming-gpio-on-the-esp8266-with-nodemcu/

  6. My objective for small was to get it to fit into a STC-1000 case. Several reasons for this:

    1) If it is small enough it will only replace the display board in the STC-1000 – hence I can re-use the on-board power supply, the buzzer and the two relay outputs. If I want SSR I’ll wire externally – but the relay (10A) is ok to start with.
    2) The small OLED display sits nicely behind the STC-1000 bezel and I can reuse the four existing switches.
    3) Most importantly (for me) is it is then a drop in replacement for the STC controller on the Grainfather – no mods required.

    I got the OLED display working with your last version and have also switched the buttons to the ADC channel with a 4 resistor divider chain – this gives four buttons on 1 pin – so everything should fit on the ESP. It works apart from detecting multiple (simultaneous) button presses (though this could be fixed by better selection of the resistor values) – as far as I can see, the software does not use multiple button presses for valid menu options ?

    Nice project – keep up your excellent work.

    I’d send some pictures of the setup, but I can’t attach as a post.

  7. Hi Darren,
    The use of ADC for buttons is brilliant. There are two cases of using combination key. The first one is UP+DOWN to back to main/idle screen at anytime. The second one is my implementation to start countdown mode in Manual mode by the combination of START+ENTER. Somehow, it reminds me the DTMF(Dual Tone, Multi-Frequency) in telephone system to recognize the keypad.
    Using original housing of GrainFather controller is a good idea too. The size of SSR with heat sink bothers me so much that I start to think how GrainFather fit the relay in the box. Does it use 10A relay? I think it should be 15A for 1600W. Maybe I should open the controller to check.

    Currently I am investigating the initial states of output PINs. The boot loader or startup code of ESP8266 seems to set some PINs as OUTPUT when booting up. The initial states last for 1 to 2 seconds before “setup” is run. We had better avoid those PINs to be used as heater or pump control. Having no access to the source code, and no scope or logical analyzer, it’s difficult to know how exact the PINs are configured at power up. The other and safer way would be using pull-down resistors.

  8. I’ll try and work out some resistor combinations that allow combination key detection.

    Yes Grainfather uses 10A mechanical relay (standard STC1000) – @240volts, 2000watt with both heaters on, which is ~8 amps. I think SSR is better for zero crossing switching (less EMI), but should be ok with standard relays in STC1000 housing as layout / filtering already proven for EMI rejection.

    I’ll check tomorrow (I have a small scope), but I think at boot all outputs are configured as inputs, so will be whatever state of the external pull-ups/pull downs. Will confirm.

    In porting your original code to the ESP, I found some problems with the buzzer function (pgmspace causing resets) – I moved the arrays to RAM and everything ok. EEPROM not working for recipe storage – will investigate tomorrow. Do you plan to put your combined WiFi code onto GitHub – would be very helpful ?

    By the way, I like your new BrewPi release also. I just bought a fridge for frementation and have a Pi & Uno setup; your ESP release is much better – will use this also. Good job.

    Thanks
    Darren

  9. So, you are using 220V version of Grainfather? Mine is US 1600W with the same box size. I wonder the relay it uses.

    I’ve tried connecting the PINs to LED and found the LED was lit up when booting up on some PINs.

    Regarding the crash, check the following code snippet, you should know what to do.

    #ifdef ESP8266
    _currentSound=(byte *)pgm_read_dword(&(_sounds[id]));
    #else
    _currentSound=(byte *)pgm_read_word(&(_sounds[id]));
    #endif
    Besides, try to search every pgm_read_xxx in all the source code, the pattern

    pgm_read_word(_sounds+index);

    should be change to

    pgm_read_word(&(_sounds[index]));

  10. Dear, Vito

    You really ported all the code to the ESP?

    Because a lack of ports, is it an option to use a shift register on the outputs.
    I now use MBSE ArdRims and there is an option to switch on your sparge kettle when the mash kettle is not heating. Therefore is it possible to use both on a 16A wall socket, only the sparge kettle is on/off an not PID which is absolutely fine.

    Do you have a schematic to use the ESP? i am currently designing a PCB with the arduino connected to a ESP12E but if the ESP8266 board can do all things i might change this before i start ordering the PCBs.

  11. Sure. I did port it to the ESP. It doesn’t take long to finish it since the structure of BrewManiac is like event-driven and good to fit in a thread of most operation systems.

    I am using a PCF8574 board as keypad/buttons input. I wanted to use the PCF8574 as output also, but I found that PCF8574 sets IOs INPUT HIGH when reset. Therefore, I connect all outputs directly to ESP8266. (Yes, a inverted circuit can solve it, which is exactly I want to avoid.) I have already built a control box by simply adding a PCF8574 board. Of course, there are SSR, a relay board, keypad, power supply, and a sensor.

    I am gonna give it a shot in next week’s brew.

    The circuit is not solid, however. For example, the driving power of the buzzer is weak, so it doesn’t make a loud sound. I want to design a D1 mini shield, but I never design any circuit. The circuit isn’t too complicated since there are a lot of examples on the web, but I even don’t know how to use EAGLE. I guess you can help me in this to create this maybe smallest brew controller.

    When implementing multiple sensor support, I have thought about providing an extra output control for sparge water heating control or maybe another kettle for mashing. (I am using a Grainfather and need to heat sparge water spiritedly.) I thought using two controller is much simpler and didn’t see much benefit from it. Now you make a good point by pointing out the possibility to use a 16A wall socket. I will think about it seriously.

Leave a Reply

Your email address will not be published. Required fields are marked *