Tuesday, November 24, 2015

P2 - ESP8266 DevBoard - CBDB nEXT EVO - Firmware


  Part 2 of the the new ESP8266 nEXT Evolution Board Series


--------------------------------------------------------------------------------------------------------------------------
For any new CBDB orders/requests please feel free to use as usual:
     tech at esp8266-projects.com.

CBDB nEXT Evo bare PCB has also been made available directly at Dirty PCBs, our preferred PCB House for experimenting (**):
 http://dirtypcbs.com/view.php?share=9699&accesskey=91d782fd4a10943fd36ecc371c7ff2cd


(**) - Actually you have there 2 Boards for the price of one, a CBDB nEXT Evo together with a secondary nEXT Extesion Board that brings you a 18Bit ADC (autoscale 0-40V input!), 4x12Bit DAC, Precison Temperature measurement, 8bit I/O port, etc. But more about this one in the next articles.  -------------------------------------------------------------------------------------------------------------------------



First thing to see is how easy is the process to configure and start using CBCB nEXT EVO Board. It will come preconfigured with NodeMCU, so, if LUA is your desired programming language you can just start using it.

   In case of firmware update needed or if you want to change the environment, it is a very easy process, almost similar with the one used for MPSM Board for example.




What we will need:




Uploading  new firmware:


  • connect CBDB nEXT EVO Board with the USB Cable.
  •  Press PROG + RESET Buttons and power up (plug it into PC USB port)
  • Start NodeMCU Flasher. Choose you USB adapter corresponding port
  • Add from Config Menu latest previously downloaded firmware. It must start from 0x0000. Disable anything else. 
  • Go back on Operation tab. Power off your CBDB Module. Press FLASH Button. power ON quick CBDB module. It will be recognised and will start flashing. Give it a second try if necessary.
  •  When finished succesfully A green OK checkmark will appear
  •  Power Off CBDB Module, Remove yellow jumper. Power back ON. Your nEXT EVO Board should be now programmed with the new NodeMCU Firmware.

If you have trouble to keep pressed both PROG and RESET buttons ,you can use a jumper from GPIO to GND as a replacement for PROG button and press just RESET when necessary:








For further programming in LUA, it might be possible to do it directly in your Serial Terminal Program but I will recomend you to use a more dedicated program for that, like ESPlorer or LuaUploader. I will stay with the latest one, for it's great flexibility and simplicity.

   To run a quick test, you can just use the code snippets provided by LuaUploader at start-up. Select the piece of code that you want to run and press "Execute Selection" button.


  • To quick setup your WIFI network :
        -- One time ESP Setup --
        wifi.setmode(wifi.STATION)
         wifi.sta.config ( "YOUR_WIFI_SSID" , "PASSWORD" ) 
         print(wifi.sta.getip())


  • For the Blinky test we will use the onboard LED connected to GPIO2 and run the code from below

                -- Blink using timer alarm --
                timerId = 0 -- we have seven timers! 0..6
                dly = 500 -- milliseconds
                ledPin = 4 -- 4=GPIO2
                gpio.mode(ledPin,gpio.OUTPUT)
               ledState = 0
               tmr.alarm( timerId, dly, 1, function()
                  ledState = 1 - ledState;
                  gpio.write(ledPin, ledState)
               end)









 For all the Arduino IDE lovers:

Arduino IDE first test for direct programming and firmware uploading on the new ESP8266 CBDB nEXT EVO DevBoard.

 Running Blinky LED program on GPIO2:

// the setup function runs once when you press reset or power the board
void setup() {
     // initialize digital pin 2 as an output - GPIO2
     pinMode(4, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
     digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
     delay(500);              // wait for a second
     digitalWrite(2, LOW);    // turn the LED off by making the voltage LOW
     delay(500);              // wait for a second
}






If you want to use it without RESET + PROG buttons control, then just solder the back jumpers as in the picture below and No manual reset needed , no buttons to press, just press Upload in Arduino IDE and that's it!







Tuesday, November 17, 2015

New ESP8266 DevBoard - CBDB nEXT EVO!


--------------------------------------------------------------------------------------------------------------------------
For any new CBDB orders/requests please feel free to use as usual:
     tech at esp8266-projects.com.


CBDB nEXT Evo bare PCB has also been made available directly at Dirty PCBs, our preferred PCB House for experimenting (**):
 http://dirtypcbs.com/view.php?share=9699&accesskey=91d782fd4a10943fd36ecc371c7ff2cd


(**) - Actually you have there 2 Boards for the price of one, a CBDB nEXT Evo together with a secondary nEXT Extesion Board that brings you a 18Bit ADC (autoscale 0-40V input!), 4x12Bit DAC, Precison Temperature measurement, 8bit I/O port, etc. But more about this one in the next articles. 
-------------------------------------------------------------------------------------------------------------------------


   This simple ESP8266 Board is the result of searching for a smaller and somehow a  more flexibile hardware configuration than the previous CBDB Evolution DevBoard. 
CBDB v2 Evo is perfect for it's Development (like the Battery Monitor System for example) and Educational purposes, you have there all-in-one-board, ADC, DAC, Voltage, Temperature and Current measurement, RTC, LCD Display, buttons, everything. 
 
   BUT sometime you want to keep is as simple as possible. Just a core. A small one. And you don't want a external/separate USB adapter. And you want to be able to extend the Board capabilities easy with other functions, as you wish and when you wish.

If this is the case then maybe the answer can be found below.



Let's see what we need for a simple ESP8266 Board:
- ESP8266 Module 
- USB adapter
- Voltage regulator
- Extension interface


ESP8266 Module 

   Just pick one from your preffered Shop, Ebay, Banggood,Amazon, etc. Ones of the best offers that I find so far (and with modules that were working OK):

 - 5pcs x ESP07 - 14.30
 - 10pcs x ESP12 - 26.99USD



ESP8266 - CBDB nEXT EVO Core


USB adapter

  For USB adapter we will use a CH340G chip. As been in a SOP16 package it is also very easy to solderat home.


CBDB nEXT EVO - USB adapter schematic

Voltage Regulator

Because I want to be able to run the board also from a Li-Ion or Li-Po Battery, for the voltage regulator decided to use something with better specifications than the usual LD1117. 

The choosen one was MCP1825S . I've use it before in many other projects and it's very good LDO: 
-  Input Operating Voltage Range: 2.1V to 6.0V
- 500 mA Output Current Capability
-  Low Dropout Voltage: 210 mV Typical at 500 mA ! - > you have about 1V for LD1117 !
- Low Supply Current: 120 μA

CBDB nEXT EVO - Voltage Regulator

 Extension interface

     The choosen nExtensions Bus Interface that will be used for connecting the ESP8266 Main Board with the other compabile available modules is very simple one, based on the I2C standard interface.  

    In the same time, you have full access to all the pins thru JP1 and JP2 pin headers. You can even use this headers to directly connect the CBDB nEXT Board to a Breadboard as they are at a breadboard friendly distance!


Putting together all the bits and pieces, this is the final result: 


CBDB nEXT EVO 3.4d Schematic



the PCB for it: 
 
CBDB nEXT Evo v3.4d PCB

  and the final result: 

CBDB nEXT Evo v3.4d Board
 
  Next we will continue with Firmware upload and some basic tests.