Go Down

Topic: Help on Rotatry encoder to scroll pages and push button to restart arduino... (Read 12832 times) previous topic - next topic

john2016



john2016

Looks fine. so what's the problem ?
hi, sorry for delayed reply,got stuck with other job, am using if statement to trigger the buzzer if kwh exceeds 1000 units but am unable to stop it after it triggers ive set delay but what happens is because i put the trigger under void loop() after the delay the buzzer short beeps for every increment it doesn't stops there , ill post the code tomorrow as idnt have ide in my home pc...

john2016

Looks fine. so what's the problem ?
hi, today i also found another problem after field testing, the problem is when there is a  power cut the unit and kwh meter gets turned off and once the power comes the counted value gets reset... i cannot use a 12 battery to keep it awake always instead am using a 12v 5amps power supply for the arduino, is there a way to tackle this issue like using a inbuilt memory function ?  so even if power cuts and come back the counter must start running from where it left ?

CrossRoads

Sure, store your results in a FRAM chip. SRAM speed for Read/writes, EEPROM non-volatility.
http://www.digikey.com/product-detail/en/cypress-semiconductor-corp/FM25040B-G/428-3200-ND/3788662
Thru hole parts no longer available.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


john2016

Sure, store your results in a FRAM chip. SRAM speed for Read/writes, EEPROM non-volatility.
http://www.digikey.com/product-detail/en/cypress-semiconductor-corp/FM25040B-G/428-3200-ND/3788662
Thru hole parts no longer available.

so, there's no way of using other option than this like a i2c module ? then i had to put a 12v 2  amp battery dedicated for it and use a charging circuit! and EEPROM  doesn't allow to read digital inputs?

CrossRoads

SPI is faster interface. I2C version can work as well.
You'll need a way to detect power loss (say a comparator that can generate an interrupt for you), and some capacitance to hold up the uC and FRAM power while you write a few bytes to it.
The capacitance can feed a boost regulator to make 5V from the decaying 5V of the capacitor, such as the attached.
Add a couple schottky diodes to isolate the cap/boost chip voltage from the regular 5V supply so the regulator isn't drained by the unpowered-power supply.


Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Onchip EEPROM takes 3.3mS to write values. SPI FRAM takes only microseconds. Smaller power hold up circuit needed.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

john2016

Hi, can i use this to store the variables less frequently?

Go Up