Showing posts with label Voltage. Show all posts
Showing posts with label Voltage. Show all posts

Friday, March 24, 2017

Thingspeak - SmartMon Ext Board P4

This is Part 4 of the SmartMon Extension Board series.

SmartMon v2.7ex Board  is a extension board fully compatible with Arduino, ESP8266, ARM, PIC & other available MCu's out there.  As long as your MCU/Dev Board has I2C Bus capabilities you are good to go!
It is probably one of the easiest ways to create your own Voltage/Current and Power consumption monitoring system for your Projects, devices, batteries, power supplies and many more!


UPDATE !! SmartMon v2.7Ex is available also on Tindie Store !





This time we will go thru a full example on how to monitor your power line and load, read Voltage/Current and Power consumtion data and upload them on the Thingspeak related Channel.

Previous Articles:


What we will need:


Software implementation:

Thingspeak channels or standalone Thingspeak Server setup part is not covered in this article.
 If interested to see how can be done a standalone Thingspeak Server, please take a look here:
1. RaspberryPI - Standalone Thingspeak Server install
2. RaspberryPI2 - Thingspeak Server install on Jessie 


To make it running, you need also the function from the previous article:

Part 3: INA219 Driver and a simple data read example 


Send data to Thingspeak function
function sendDataTh()
    print("Sending data to thingspeak.com")
    conn=net.createConnection(net.TCP, 0)
        conn:on("receive", function(conn, payload) print(payload) end)
        -- api.thingspeak.com 184.106.153.149
        conn:connect(80,'184.106.153.149')
        conn:send('GET /update?key=T89U8XLJDPQTW0AR&field1='..volt..'&field2='..current..'&field3='..power..'&field4='..peng..'HTTP/1.1\r\n')
        conn:send('Host: api.thingspeak.com\r\n')
        conn:send('Accept: */*\r\n')
        conn:send('User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.1)\r\n')
        conn:send('\r\n')
        conn:on("sent",function(conn) print("Closing connection")
        conn:close()
    end)
    conn:on("disconnection", function(conn) print("Got disconnection...")
    end)
end 


Main Program
---- INA216 Module TEST
init_i2c()
setCAL_reg()
print_values()
If you want to read and update values every minute add function from below:
tmr.alarm( 1, 60000, 1, function()
     print_values()
     sendDataTh()
end)
You can stop your running timer anytime with:
tmr.stop(1)

Thursday, March 16, 2017

Smart Mon Ext Board - Software example - P3

This is Part 3 of the SmartMon Extension Board series.

  SmartMon v2.7ex Board  is a extension board fully compatible with Arduino, ESP8266, ARM, PIC & other available MCu's out there.  As long as your MCU/Dev Board has I2C Bus capabilities you are good to go!
It is probably one of the easiest ways to create your own Voltage/Current and Power consumption monitoring system for your Projects, devices, batteries, power supplies and many more!


UPDATE !! SmartMon v2.7Ex is available also on Tindie Store !






Previous Articles:


What we will need:


Software implementation

1.  INIT Data
id = 0
sda = 2
scl = 1
devaddr = 0x40   -- A0,A1 = GND

voltage = 0
current = 0
power = 0
peng = 0
eng = 0

2. I2C  Init function 
function init_i2c()
  i2c.setup(id, sda, scl, i2c.SLOW)
end

3. INA219 Reset function
function reset()
  write_reg(0x00, 0xFFFF)
end

4. Read register function
 --read from reg_addr content of dev_addr
function read_reg_str(reg_addr)
  i2c.start(id)
  i2c.address(id, devaddr, i2c.TRANSMITTER)
  i2c.write(id,reg_addr)
  i2c.stop(id)
  tmr.delay(1)
  i2c.start(id)
  i2c.address(id, devaddr, i2c.RECEIVER)
  c=i2c.read(id, 16) -- read 16bit val
  i2c.stop(id)
  return c
end

5. Read register function - 16bit--returns 16 bit int
function read_reg_int(reg_addr)
  i2c.start(id)
  i2c.address(id, devaddr, i2c.TRANSMITTER)
  i2c.write(id,reg_addr)
  i2c.stop(id)
  tmr.delay(1)
  i2c.start(id)
  i2c.address(id, devaddr, i2c.RECEIVER)
  local c = i2c.read(id, 16) -- read 16bit val
  i2c.stop(id)
  --convert to 16 bit int
  local val = bit.lshift(string.byte(c, 1), 8)
  local val2 = bit.bor(val, string.byte(c, 2))
  return val2
end

6. Write register function
function write_reg(reg_addr, reg_val)
  print("writing reg:" .. reg_addr .. ", reg_val:" .. reg_val)
  i2c.start(id)
  i2c.address(id, devaddr, i2c.TRANSMITTER)
  local bw = i2c.write(id, reg_addr)
  local bw2 = i2c.write(id, bit.rshift(reg_val, 8))
  local bw3 = i2c.write(id, bit.band(reg_val, 0xFF))
  i2c.stop(id)
end

7. Calibration / settings function
function setCAL_reg()
  maxVoltage = 32
  maxCurrentmA = 10000
  write_reg(0x05,3950) --CALIBRATE FOR YOUR rshunt & stuff
  local config = 15391
  write_reg(0x00, config)
end

8. Read Current values (mA)
 function getCurrent_mA()
  local valueInt = read_reg_int(0x04)
  return valueInt
end

9. Read Bus Voltage (V)
 function getBusVoltage_V()
  local valueInt = read_reg_int(0x02)
  -- Shift to the right 3 to drop CNVR and OVF and multiply by LSB = 4
  local val2 = bit.rshift(valueInt, 3)
  local val2 = val2 * 4
  return val2 * 0.001
end

10. Read Shunt resistor voltage drop (mV)
function getShuntVoltage_mV()
  -- Gets the raw shunt voltage (16-bit signed integer, so +-32767)
  local valueInt = read_reg_int(0x01)
  return valueInt * 0.01
end

11. Read Bus Power (W) 
function getBusPowerWatts()
  local valueInt = read_reg_int(0x03)
  return valueInt*20*0.001
end

12. Print read values 
 function print_values()
  volt = getBusVoltage_V()
  print("\nVoltage  :  " .. volt.." V")
  current = getCurrent_mA()/1000
  power = getBusPowerWatts()
  if (current > 65 ) then
         print("ERR 00.23")
         current = 0
         power = 0
  end
  eng = eng + power/60
  print("Current  : " .. string.format("%6.3f",current) .." A")
  print("Power    :  " .. power .." W\n")
  print("Energy   : " .. string.format("%6.3f",eng) .." Wh\n")
end

MAIN Program
---- INA216 Module TEST
init_i2c()
setCAL_reg()
print_values()

If you want to read and update values every minute add function from below:

tmr.alarm( 1, 60000, 1, function()
     print_values()
     sendDataTh()
end)
You can stop your running timer anytime with:
tmr.stop(1)




That's all for today, next time we will more further and we will go thru a full SmartMon Battery Monitor System + Thinkspeak data upload example.
 


Creative Commons License All schematics, boards, software and articles released by ESP8266-Projects.com are licensed under a Creative Commons Attribution-NonCommercial 4.0 International License









Friday, October 14, 2016

Smart Mon Ext Board - RTC clock driver example - P2



Part 2 of the SmartMon v2.7ex series.


UPDATE !! SmartMon v2.7Ex is available also on Tindie Store !



    This time we are exploring the Real Time Clock  implementation and we will see how easy or complicated is to set & program the onboard RTC Clock.







   And the story behind:

    For a complete monitoring/ data logging experience, a nice to have feature is a proper RTC clock. Having this in mind, for the new version of the SmartMon I choose to add it on-board for a very simple and easy integration in your related Voltage, Current, Power projects.

   The choosen one is the PCF8563 from NXP, a very nice and easy to program CMOS Real-Time Clock (RTC) and Calendar optimized for low power consumption. A programmable clock output, interrupt output and voltage-low detector are also provided. All addresses and data are transferred serially via a two-line bidirectional I2C-bus with a maximum bus speed of 400 kbit/s.


Features: 

     •  Provides year, month, day, weekday, hours, minutes, and seconds based on a

        32.768 kHz quartz crystal
     •  Century flag

     •  Clock operating voltage: 1.0 V to 5.5 V at room temperature

     •  Low backup current; typical 0.25uA at Vdd =3.0V and Tamb=25C


     •   400 kHz two-wire I2C-bus interface (at VDD= 1.8 V to 5.5 V)

     •   Programmable clock output for peripheral devices (32.768 kHz, 1.024 kHz, 32 Hz, and 1Hz)

     •   Alarm and timer functions - separate Alarm triggered MOSFET output with separate voltage   
                     input/supply included onboard, can direct drive upto 2A external devices, 3/5/12V 
                     Relays, interrupts, etc

     •   Integrated oscillator capacitor

     •   Internal Power-On Reset (POR)

     •   I2C-bus slave address: read A3h and write A2h

     •   Open-drain interrupt pin




Schematic:


SmartMon v2.7Ex - RTC module schematic

 For more details about the RTC, please see PCF8563 Datasheet and the related PCF8563 RTC clock driver Article



What we will need:

    Connection with the ESP8266 nEXT EVO Board is very easy, as Analog Extension Board - AN1 connector is fully compatible with the nEXTBus connector:

SmartMon v2.7Ex Board

    This time we are talking here about ESP8266/LUA driver but also Arduino implementation will follow.

    If you use another ESP8266, or Arduino, ARM, PIC, whatever MCU you use there days for your projects, then just be sure that you are connecting the I2C lines (SDA/SCL) on the allocated pins for your setup.


Driver implementation


    As PCF8563 has a I2C compatible compatible interface, driver building it following more or less the same  process  as before for I2C devices.

   For more details about the RTC, please take a deeper look at the  PCF8563 Datasheet and the related PCF8563 RTC clock driver Article.



1. Data conversion functions:

  1.1 Decimal to BCD:


        function decToBcd(val)
             local d = string.format("%d",tonumber(val / 10))
             local d1 = tonumber(d*10)
             local d2 = val - d1
            return tonumber(d*16+d2)
         end

  

1.2  BCD to Decimal:

      function bcdToDec(val)
           local hl=bit.rshift(val, 4)
           local hh=bit.band(val,0xf)
          local hr = string.format("%d%d", hl, hh)
          return string.format("%d%d", hl, hh)
     end


 
2. Init I2C bus/interface:

        address = 0x51, -- A2, A1, A0 = 0
        id = 0


        init = function (self, sda, scl)
               self.id = 0
              i2c.setup(self.id, sda, scl, i2c.SLOW)
       end

 

3. ReadTime function:

   readTime = function (self)
       wkd = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }
       i2c.start(self.id)
       i2c.address(self.id, self.address, i2c.TRANSMITTER)
       i2c.write(self.id, 0x02)
       i2c.stop(self.id)
       i2c.start(self.id)
       i2c.address(self.id, self.address, i2c.RECEIVER)
       c=i2c.read(self.id, 7)
       i2c.stop(self.id)
       return  bcdToDec(bit.band(string.byte(c,1),0x7f)),
               bcdToDec(bit.band(string.byte(c,2),0x7f)),
               bcdToDec(bit.band(string.byte(c,3),0x3f)),
               bcdToDec(bit.band(string.byte(c,4),0x3f)),
               wkd[tonumber(bcdToDec(bit.band(string.byte(c,5),0x7)))],
               bcdToDec(bit.band(string.byte(c,6),0x1f)),
               bcdToDec(string.byte(c,7))
   end



4. SetTime function:

   setTime = function (self, second, minute, hour, day, date, month, year)
       i2c.start(self.id)
       i2c.address(self.id, self.address, i2c.TRANSMITTER)
       i2c.write(self.id, 0x02)
       i2c.write(self.id, decToBcd(second))
       i2c.write(self.id, decToBcd(minute))
       i2c.write(self.id, decToBcd(hour))
       i2c.write(self.id, decToBcd(day))
       i2c.write(self.id, decToBcd(date))
       i2c.write(self.id, decToBcd(month))
       i2c.write(self.id, decToBcd(year))
       i2c.stop(self.id)
   end



For testing,  pack it together and save the code on ESP as 'pcf8563.lua', restart ESP and run:

-- Set Initial Time and Date
require('pcf8563')                                -- call for new created PCF8563 Module Driver
sda, scl = 2, 1                                      --  declare your I2C interface PIN's
pcf8563:init(sda, scl)                          
-- initialize I2C Bus

 pcf8563:setTime(0,34,13,12,4,3,15)   -- setTime(s,min,hour,day,weekday,month, year)
-- get Time and Date
require('pcf8563')
sda, scl = 2, 1
pcf8563:init(sda, scl)


s, m, h, d, dt, mn, y = pcf8563:readTime()        --ReadTime function call
=string.format("%s - %s/%s/20%s",dt, d, mn, y)
=string.format(" %s:%s:%s", h, m, s)



Next Article in series can be found here Part 3: INA219 Driver example and software implementation


Creative Commons License SmartMon series boards, software and articles by ESP8266-Projects.com are licensed under a Creative Commons Attribution-NonCommercial 4.0 International License



Monday, October 3, 2016

Smart Mon Ext Board - Voltage, Current, Power monitor - P1



UPDATE !! UPDATE !!

Available also on Tindie Store !








And the story behind:

Do you remember the BLMS (Battery Live Monitor System) Project?

Today we will start a new Battery Live Monitor System (BLMS) series related with the SmartMon v.2.7Ex Board.

   SmartMonv2.7Ex board has been born as the next generation of BLMS, bringing more flexibility and a lot of extra functionalities than the previous one.

   If you want to quickly add to your project Voltage, Current and Power monitoring capabilities, plus, as a bonus, a proper hardware RTC with integrated Alarm and Timer functions, this is the extension board that you was looking for.

  The modular design will let you to easy connect it and use it with any MCU you want as long as it has I2C bus capabilities  and is working in the 3-5.5V voltage range. That includes all the popular existing platforms like Arduino, PIC, ARM, Atmega, ESP8266 and many more!



Because of the ammount of the information, the related main Videos and Articles are splitted in 4 Parts, as follow:

Part1 - General view
Part2 - Real Time Clock driver example
Part3 - Power Monitor software example
Part4 - Real World example with Thinkspeak data upload



Part 1 - GENERAL VIEW


FEATURES:

  • TI INA219 integrated high-side current shunt and power monitor
  • High precision, high quality shunt resistor from BOURNS: very low Inductance (10nH) and Temperature Coeficient ( ±20 ppm/°C max.)  
  • Measured Bus Current interval: 0-10A (standard) / 0-20A (optional) 
  • High range Measured Bus Voltages from 0 to 26 V
  • Bus voltage is measured directly on the load side of the shunt resistor
  • SmartMon v.2.Ex Power supply voltage range - 3.3 to 5.5V
  • Standard I2C bus communication ( nEXT Bus connector)
  • PCF8563 RTC - real-time clock and calendar optimized for low power consumption
  • RTC Alarm and timer functions with MOSFET driven Interrupt output
  • On-board regulator option (can be populated and used it when you want to use the same main BUS Voltage input also as a power supply for the SmartMon Board)



Schematics:


High-side Voltage measurement, current shunt and power monitor


 
RTC


Main Bus Voltage Regulator - optional



PCB: 

SmartMon v2.7Ex - Bottom


SmartMon v2.7Ex - TOP



























 Next time in Part2 we will continue exploring the SmartMon v2.7Ex Board and also entering on the software side, talking about the  Real Time Clock usage, Driver example, etc.


Tuesday, June 2, 2015

Mailbag Arrival !! ACS712 Current Sensor Board




   Because of the very cheap ACS712 Current Sensor Board modules available all over the place, I really think that everybody heard about ACS712 sensor from Allegro MicroSystems.

  As I was asked if "Can be used as a current sensor module for our ESP8266 Projects without too much hustle?", I ordered few of them and let's explore them for the answer :)

   The ACS712 device consists of a precise, low-offset, linear Hall circuit with a copper conduction path located near the surface of the die. That means that it is a isolated path device, a very nice thing if you want to monitor MAINS Current or any other High Voltage path that you want isolated from your device.

IMPORTANT NOTE !!  This device is a Hall Effect transducer.  It should not be used near significant magnetic fields.  If you have a magnetic noisy environment take a look at other solutions like isolation transformers, isolation OpAmps, linear isolation circuit, bus path isolation, etc.


 Theory of operation 

 Applied current flowing through the ACS712 copper conduction path generates a magnetic field which the Hall IC converts into a proportional voltage. Device accuracy is optimized through the close proximity of the magnetic signal to the Hall transducer.
A precise, proportional voltage is provided by the low-offset, chopper-stabilized BiCMOS Hall IC, which is programmed for accuracy after packaging.

  The ACS712 outputs an analog signal, VIOUT that varies linearly with the uni- or bi-directional AC or DC primary sampled current, IP (between IP+ e IP-) within the range specified.

  It requires a power supply of 5V (VCC) and two capacitors to filter power supply and output.
CF is recommended for noise management, with values that depend on the application.

Typical application from the Datasheet: 



   ACS712 Current Board comes in 3 different models of this integrated circuit, depending on the maximum measured current : 5A  20  or  30A

5A Module20A Module30A Module
Supply Voltage (VCC)     5VDC     5VDC        5VDC
Measurement Range   -5 to +5 A   -20 to +20 A        -30 to +30 A
Voltage at 0A   VCC/2     VCC/2      VCC/2
Scale Factor   185 mV/A   100 mV/A      66 mV/A
Variant  ACS712ELC-05A   ACS712ELC-10A     ACS712ELC-30A


   For our today experiment, I will use the one below, a 100mV/A one:




What we will need:
  •  ACS712 Current Board module (pick your desired choice -  5A, 20A, 30A )
  • CBDB Board ( or any other ESP8266 Board you may like but who has the same capabilities)
  •  USB adapter (take a look on Part 1 for details about the USB Adapter 
  •  2 x 10 Ω /10 W  - Load resistors
  • Connection wires - various colors
  • Breadboard
  • Bench Power Supply 
  • Voltage Level Shifter and dc amplifier module - VLSAM DC(see details below)


Voltage Level Shifter and amplifier module - VLSAM DC

  As our main goal is to explore the posibility to use the ACS712 module with ESP8266 devices, from the description above and datasheet we can identify very quick some problems that need to be solved to make ACS712 a "ESP Friendly" device:

ASC712: 
  •  5 Vdc power supply device
  •  measure positive and negative 5/20/30Amps, corresponding to the analog output 100mV/A BUT
  • "ZERO" point, means no test current through the output voltage is VCC / 2 =5v/2=2.5V !

ESP8266:
  • 3V only device
  • ADC range  max: 0-1V

  What we will need is to "move" the "ZERO" point as low as we want to GND and in the same time to amplify the received analog signal to obtain a better resolution in the desired measuring range. (don't forget, for our experiment we have DC only voltage here and just one current flow direction)

   So, what can be done? 

Probably they are some other solutions to this problem, and if you know any of them, please feel free to share in the comments below, but the clasical one is to use a difference amplifier:





    This kind of amplifier uses both inverting and non-inverting inputs of a OPAmp with a gain of one to produce an output equal to the difference between the inputs. Actually if you take a closer look it is a special case of the differential amplifier.
   The good thing is that in the same time you can also choose the resistances values in a way to amplify the difference

    If all the resistor values are equal, this amplifier will have a differential voltage gain of 1. The analysis of this circuit is essentially the same as that of an inverting amplifier, except that the noninverting input (+) of the op-amp is at a voltage equal to a fraction of V2, rather than being connected directly to ground. As would stand to reason, V2 functions as the noninverting input and V1 functions as the inverting input of the final amplifier circuit. Therefore:

                  Vout = V2 - V1

    If we want to provide a differential gain of anything other than 1, we would have to adjust the resistances in both upper and lower voltage dividers, necessitating multiple resistor changes and balancing between the two dividers for symmetrical operation.

    A limitation of this simple amplifier design is the fact that its input impedances are rather low compared to that of some other op-amp configurations, most notably the noninverting (single-ended input) amplifier. Each input voltage source has to drive current through a resistance, which constitutes far less impedance than the bare input of an op-amp alone. It is a solution to this problem, fortunately, quite simple,  all we need to do is “buffer” each input voltage signal through a voltage follower.


   For our case, as we want to "substract" the ACS712 - 2.5Vdc to move the "ZERO" point near GND, we will have:
  • V1 = 2.5V - can be easy obtained from 5V with a buffered voltage divider
  • V2 = VIOUT - output voltage from ASC712 Module
  • Amplification:
    • IF R1=R2=R3=R4=10K 
      •  output for ADC input of 100mV/A
      • max range: 10A
      • resolution:  10mA
    • Changing range  R1=R2=10K, R3=R4=100k 
      • output for ADC input of 1V/A
      • max range: 1A
      • resolution: 1mA


VLSAM DC Schematic


And the simulation result for a 0-10A, 2.5-3.5 VIOut sweep:


  • GREEN      - Voltage divider output  : 2.5Vdc
  • FUCHSIA  -  ASC712 VIOut            : 2.5 -> 3.5Vdc
  • RED           -  ADC input                   : 0 -> 1Vdc


So far so good, let's move it on a breadboard for a quick test:




Wednesday, May 27, 2015

Raspberry PI - Standalone Thingspeak Server installation



UPDATE !! UPDATE !! UPDATE !! UPDATE !!

New fresh install instructions based on the new RASPBIAN Jessie: Raspberry PI2 + Thingspeak Server on RASPBIAN Jessie

-------------------------------------------------------------------------------------------------

Original Article

     As you might read already in my previous  ESP8266 Battery Monitor System  post I was using Thingspeak.com, because of it's flexibility, as a logger for live data uploading.
In the latest week I was exploring deeper Thigspeak capabilities.

   As you know, Thinspeak.com it's a open source project, and you have full access to the project sources on Github 

   What I was interested for was to check the possibility to build/configure and use a standalone Thingspeak Server that can run independently of Internet infrastructure on a small footprint, low power consumption platform.
   The interesting part regarding the Thingspeak Server deployment is the chosen platform, the new RASPBERRY PI 2 Board!


 



    I will present you below the step-by-step process to install your own RPI Thingspeak Server that can be tailored on your own needs and ofcourse, not affected by Internet connection availability and uptime if installed in the same physical location/LAN as your ESP8266 BMS or any sensor grid/array you might want to use with!






INSTALLATION PROCESS:


1.  Install a Raspberry Pi Operating System image on SD card

  •  Download the Raspbian image from RPI website
  •  Write image to SDCard
    For more details please read RPI Install Guide

I was using the Win32DiskImager utility under W7Pro for that, worked like a charm.




2. First RPI RUN with the new SDCard:


  • Inset card in RPI2
  • Boot 
  • From raspi-config:
              - Set to use entire SDcard space
              - Set hostname: RPIMON1
              - Enable SSH Server
              - Write down your new RPI IP: 192.168.2.xx

  • Reboot for apply new hostname & settings
                pi@RPIMON1~$ sudo reboot



3. System Update & required packages install
  • Switch over to SSH remote access with Putty - accept new key


  • Change "pi" account password:
                  pi@RPIMON1~$passwd
  • Set ROOT password, so you can then use root (just for very, very special things!)
              pi@RPIMON1~$sudo passwd root

  • System Update & upgrade  :
              pi@RPIMON1~$sudo apt-get update            
              pi@RPIMON1~$sudo apt-get upgrade          
              pi@RPIMON1~$sudo apt-get dist-upgrade   
              pi@RPIMON1~$sudo sync

  • Reboot:
            pi@RPIMON1~$ sudo reboot


  • Required packages:
           pi@RPIMON1~$sudo apt-get -y install build-essential git mysql-server mysql-client 
                                       libmysqlclient-dev libxml2-dev libxslt-dev libssl-dev libsqlite3-dev


4.  MySQL Database configuration


pi@RPIMON1~$mysql --user=root mysql -p useyourpasswd here
pi@RPIMON1~$mysql> CREATE USER 'thing'@'localhost' IDENTIFIED BY 'speak’;
pi@RPIMON1~$mysql> GRANT ALL PRIVILEGES ON *.* TO 'thing'@'localhost' WITH GRANT OPTION;
pi@RPIMON1~$mysql> commit;
pi@RPIMON1~$mysql> exit;




5.  Ruby & Rails install

          pi@RPIMON1~$wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz
          pi@RPIMON1~$tar xvzf ruby-2.1.5.tar.gz
          pi@RPIMON1~$cd ruby-2.1.5
          pi@RPIMON1~$./configure
          pi@RPIMON1~$make
          pi@RPIMON1~$sudo make install
          pi@RPIMON1~$cd ..
          pi@RPIMON1~$echo "gem: --no-rdoc --no-ri" >> ${HOME}/.gemrc
          pi@RPIMON1~$sudo gem install rails




 6.  THINGSPEAK SERVER INSTALL

pi@RPIMON1~$git clone https://github.com/iobridge/thingspeak.git
pi@RPIMON1~$cp thingspeak/config/database.yml.example thingspeak/config/database.yml
pi@RPIMON1~$cd thingspeak
pi@RPIMON1~$bundle install
pi@RPIMON1~$bundle exec rake db:create

pi@RPIMON1~$mysql --user=root mysql -p
pi@RPIMON1~$mysql> show databases;
pi@RPIMON1~$mysql> exit;





IF all OK continue with loading Thingspeak DB configuration

pi@RPIMON1~$bundle exec rake db:schema:load




RUN the THINGSPEAK SERVER:

pi@RPIMON1 ~/yourthingspeak $ rails server webrick






And the result in Browser:

Running Thingspeak on RPI Board

Create new Thingspeak USER:

Thingspeak Signup page


Create new CHANNEL

Create new channel for ESP8266 BMS data upload


Live Data update:

ESP8266 BMS  - Live data upload


UPDATE !! UPDATE !! UPDATE !! UPDATE !!

New fresh install instructions based on the new RASPBIAN Jessie: Raspberry PI2 + Thingspeak Server on RASPBIAN Jessie