AC line detection with two components

May 26, 2016

ac-line-detection-with-two-components  Facebook  Twitter  Google +  

 few months ago my 4yrs old ups died due to water exposure while working at balcony. it was very functional thing, can handle 2kva load which powering electronics of whole home, provides detailed measurements about AC line and battery status etc. even you can sense the whole district's power load by observing the ac line graph.


 Tried to buy same device but no luck, even manufacturer company not exists anymore. so i purchased an used ups with $15 and upgraded it to handle more capacity. details available in this instructables entry.
 It's working fine but my software customizations become obsolete with this ancient hardware. decided to measure electricity myself by using third party arduino modules but none of them simply telling is electricity exists or not. i was about to connect 5v cellphone charger output to arduino's analog pin then got the idea while testing it by using my screwdriver.
 Most screwdrivers got NE-2 neon lamps to test mains voltage which beaming a barely visible light when connected to AC voltage. i removed the lamp, attached a photoresistor (aka LDR) and wrapped them with black tape to prevent any external light source.

 tada! i have a AC measurement module with analog output. connected it to my sensor box and did minor modifications on software stack. now my home automation software can detect power interruptions and take actions such as turn off appliances to save battery or go hibernate to prevent data loss.
 current setup not measuring remanining battery but it's fixed, current capacity is exact one hour, i configured the instructions to automatically take action after 30 minutes.
 Total cost
 + 1x screwdriver with test feature
 + 1x photoresistor
 + tape and bunch of cables
 + male electrical plug
 + 1 business day of software development.


Gadget upgrade: Relay Box

May 05, 2016

gadget-upgrade-relay-box  Facebook  Twitter  Google +  

 At the first days of 2016, mentioned about my new relay box in that entry it contains a ssr relay module which can handle 220v voltage with 2amp current. the motivation of building a new box instead using existing one was emf problem, each cycle of relay causing electromagnetic interference and resetting the onboard microcontroller. sounds like not big deal but it's serious when your computer turning on the jukebox at highest audio level and playing music about 3 days while you're out of city. true story.

 We're eliminated this issue with a new box but problems are never ending. this time messing with extreme heat. i put an extra relay which can handle upto 220v/10amp for solder and stove, everything was going good until relay melts the plexiglass structure of box.
 I got a small aluminium case laying around there which in exact size of the box, i mounted it by using 10mm screws with one finger distance. plus integrated a micro sized 12v fan for box cooling. such a minor functionality but result is looking like fusion generator biggrin.gif
 while it's open, i also implemented an AC capacitor to terminals which gathered from a dead hair dryer and guess what, that's completely solved the emf problem. at least it's stable since 5 months.
 So what it does now, it's connected to my home automation software. previously mentioned about air quality sensor, it's measuring the air quality with various sensors. today it's the same device, just redesigned the casing and added connection heads for external PIR sensor same software analyzes sensor values from this device and turning on/off connected appliances based on levels. for example, i don't smoke cigarette even i hate it. if somehow a guest smokes at another room, particle levels in environment increases about 10% and software turns on the air ventilator fan at the wall. same scenerio applies to LPG, extreme deodorant usage and even fart biggrin.gif
 another example is air conditioning, i survived from whole winter with my small stove. it's enough for 5.5m2 room in our climate area. sofware determining first if there is someone exists in room by pir sensors then launching the stove for 20 minutes if temperature is below 15c.
 whole workstation also connected to a portable ups, i created a battery monitoring system afterwards to prevent take any automatic actions. cheap ups systems does not have a usage limiter, we don't want to fry our batteries if got electiricity interruption on stove usage.
 another motivation was production price. maybe not at 2002 but similar devices available on ebay today starting from $100. my total spent resources is:
 1x 10A ssr relay: $10
 1x 2A ssr relay module (4 relays): $15
 5x female electricity outlet: $5
 Plexi casing already available but let's say $2
 Total spent: $32 + 1week


Indoor gardening ep2: Monitoring vitals with esp8266

April 17, 2016

indoor-gardening-ep2-monitoring-vitals-with-esp8266  Facebook  Twitter  Google +  

 usually companies creating understandable terms for each new product category like "blue energy balls" or "flapping little bee" the internet of things is one of them. wikipedia says it's the term for communicating embedded devices each other via wide area networks. actually that's cool way to describe microcontroller with tcp stack which is already exists in market since decades.

 in previous air freshener entry, i mentioned about my implementation attempt of esp8266 based esp-01 board to a basic security system. it wasn't worked but i figure out the problem later and started to build a remote telemetry probe for my next set of crops.
 esp-01 is controllable via serial AT commands. even you can make http requests like multi-purpose gprs modems. first of all, i was stuck at the network scanning part. that's related with power consumption. it's hitting to 200ma while scanning & connecting to wifi networks which is close to supply limit of arduino board. i fed it with an external +3.3v power supply and solved this one.
 second problem is uart noise, obviously that board got the firmware from early esp days and not accepting the bitrate set command. i applied a cloud update command which is seen in reference document and completely bricked the device. i was assuming a firmware update will bring these advanced commands and fix that issue by minor a tweak. reviving the module is another story, i mentioned at this instructables entry.
 first tests was based on arduino mini pro decided to go with uno r3 to accelerate software development part after few write cycles, plug-in & plug-out on each upload is literally a torture. got a stable sketch after 4-5 revision.
 currently it's sending me the outdoor temperature, soil humidity and outdoor light level. same as previous setup, my personal assistant software "judith" handling the http posts and notifies me if soil getting dry or outdoor temperature drops below lettuce's acceptable range. an 12v/7ah ups battery powering it about 8 days with 30 minutes of send interval. planning a solar charger with li-ion battery for it in my next spare time.
 Cost table
 + ESP-01 wifi board: $5
 + Arduino Uno R3 (clone): $3
 + HL-69 soil moisture sensor: $2
 + ds1621 thermometer module: $2
 + light resistive diode: $0.5
 took 3 days to develop, 3 weeks to fix errors. for sake of time don't buy chinese clones of esp8266. an extra $5 can save your whole month. if interested, source code available in devzone section and github


New update: MSP v1.1.0

March 25, 2016  Facebook  Twitter  Google +  

 + modified the feature activation behaviour
 + new option: change case of letters
 + drag & drop from desktop


Indoor gardening ep1: Trial and Failure

March 19, 2016

indoor-gardening-ep1-trial-and-failure  Facebook  Twitter  Google +  

 I tried something new at last days of 2015 and decided to grow my own vegetables in workroom. due to date of attempt, motivation was clear: The martian. probably i said if mark watney can grow crops in it's own shit i can grow my vegetables at anywhere.

 Decided to go with romaine lettuce which is base element of salads. first of all, purchased two sets of big flowerpot and peat which available in any home store. that was my first mistake, lettuce's head is bigger than it's root i should use regular red or brown soil which can keep the plant straight.
 Anyway filled the pot with peat, planted heater wires and watering tubes which is already laying around in my toy box. that was second mistake, lettuces likes cool environment, probably my research was about another subspecies.
 I seen first leafs in next week and they're reached to approx 10cm after 30 days. everything is okay until there but they're stopped growing after some point. not growing not dying, just consuming water. maintenance was semi-automatic, i purchased two timer outlets one of them turning on the heating wires for nights and one of them starting the pump in each 48 hrs. i was just observing and re-supplying water at each week.
 in total 100 days, environment temperature dropped below 15c due to season and i moved them to my workroom. there isn't sunlight out there about a month already, i fed them with a led light bulb but didn't noticed any progress. even most of them dead.
 finally i give up and used all of them in my next meal. taste was eccentrically delicious unlike regular market products, it's definitely worth for effort.
 Cost table
 + two pair of pots: $10
 + heating wire: $2.5
 + aquarium pump and hose: $3
 + timer outlets: $6
 + seeds: $1
 + peat: $1
 Lessons learned
 - temperature should between 14~28c for romaine lettuce
 - seeds needs to sow at least 5cm deep
 - led lightning just not enough, they're needs a full-spectrum light source
 - use more dense soil, preferably red
 - keep distance between seeds, they're interfering sunlight of each other when they're growth.
 after cleaning the mess up, i moved empty pot to a dark storage room. surprisingly they're still alive after 6 months. 

 stay tuned for next entry.


New update: Kantharos IDE v1.2.2

February 19, 2016  Facebook  Twitter  Google +  

 - toolbar buttons were taking wrong actions, issue fixed
 - updated php installation to v5.6
 - fixed access error issues while creating process pipe


The forgotten release: MSP

February 14, 2016  Facebook  Twitter  Google +  

 it's short for "Mass String Processor" which developed in 2007 to clean up blocks of text after copy-paste operations. actually i'm using online services when i need this kind of text maintenance but my opinion it's duplicate line removal feature still worths it to keep in personal software arsenal.


New assignment to Air Freshener

January 02, 2016

new-assignment-to-air-freshener  Facebook  Twitter  Google +  

 Few weeks ago i moved to a new place which is bigger than my previous lair. we're decided to install an alarm system and story started from there. actually i got nothing to steal even if a burglar break into my house he probably pity me and lay down some money on the table before leaving with full of tears.

 An average alarm system starting from approx $350~400 in here. that's serious funds if we convert it to local currency. did a quick math with cons & pros and decided to build my own by using an arduino ethernet shield

 First attempt
 After the release of wifi enabled ESP8266 dev boards, ethernet modules even arduino itself getting obsolete. before anybody say "overkill" to arduino+ethernet bundle for this scale of project, i would like to mention it's laying around since two years. anyway, i found an automatic air spray box and installed the pir sensor and arduino board on it which is took two hours. then created a simple sketch based on arduino's ethernet client samples and my growl like desktop notification software "judith" handled the rest of job. i assigned turret sound effects from the game portal just for fun and written a timer code to wake the whole apartment if got room activity after 00:00am.

 False alarms
 Well, that was done in total 3 hours but not effective as i predicted. so next day i updated the sketch by adding an extra error correction feature. pir sensor should triggered at least 25ms in new version. that's worked but still got false alarms from nothing. researched almost everything, spent whole business day to figure out the problem and noticed the inactivity while wifi router rebooting. internet service provider's modem also supports 5ghz wifi which is causes signal interference like cell phones. i used a longer cable and put a distance between router and device and problem solved. at least for next 3 days.

 Corrections & upgrades
 Everything looks good but still got minor lags between movement and notification at pc, in third version i removed all delays from sketch and used time based events. in the most recent code temperature and light sensor data sending in 3 seconds of interval and pir sensor activity pushing to server immediately. also prevent double notifications, i put 300ms delay to each motion event. you can check out the final version in devzone section.

 if i purchase it, probably will costs me about $50~ but currently just taken my two business days. and i can tell it's definitely worth it based on last one week of usage. at least i can aware about who in which room while i'm working on my pc.

 by the way will mention about the backend software in next entry with a "crash-free" version of it.


Making of: Yarn Lantern

December 24, 2015

making-of-yarn-lantern  Facebook  Twitter  Google +  

 Making things not always about inventing something new. it's also about price, actually price tag of similar product motivates more rather than it's unique or not.

 I'm usually purchasing electronics & home appliance from ebay or china based markets due to it's price. few weeks ago i was looking for a simple chandelier. interested with one in a local store but price was extremely high for a non-essential need.

 so, i taken a closer look then go out with 50m straw rope and wood glue instead of original product. few years ago i was seen a youtube video about how to make it and my attempt was quite succeeded based on my guests feedback.

 original product = $80
 handmade version = $9.5

 if interested with how to do it, posted an instructables entry about that.


100 lux in pocket: Power LED

October 28, 2015

100-lux-in-pocket-power-led  Facebook  Twitter  Google +  

 in year 2015 maybe we don't have flying cars but got smd leds anyway. i don't know why but people calling it "power led" in turkey and they're almost everywhere. it's cheap, lasts longer and draws lower electricity profile than traditional light bulbs.

 long time ago i modded a garage door remote by implementing eight white leds on it. they're drawing 1.5v each and powered by an 12v A23 battery

 past year i purchased two smd led modules from dealextreme just for upper rounding a shopping cart. after the received package, did an experiment and replaced the white leds on my keychain with this ones. i was guessing battery only lasts about 1 or 2 months with barely use.

 surprise! battery still alive since 1.5 years but somehow half of leds are died. today i'm replaced the module and battery then taken few photos.

 summary: A23 battery+SMD led = brightest & smallest light source ever.

Older Entries