Recent Posts

Pages: 1 ... 6 7 [8] 9
71
Decider / New Feature - TORX Time Definitions
« Last post by Cube on September 26, 2015, 06:18:53 PM »
Decider 0.5.0-459 marks a key new feature, one which has long been on my wish list. It gives Decider a number of new capabilities for scheduling things to happen, and it also incorporated an idea I've been meaning to implement for years. In order to appreciate the Torx Timer, you have to understand the history. For that, let me begin with a story.

When I was a little boy, my father and I used to collect stuff from commercial and industrial bins around the city. You simply would not believe some of the items that people threw out in those days, and my collection quickly grew to include all manner of security systems, built-in vacuum cleaner parts, intercom systems, cameras, sensors, motors, switches, speakers, transformers, tools, amplifiers, sprinklers, light fixtures, humidifiers (both ultrasonic and steam) - the list was nearly without end. Some things needed minor repair, but most worked as we found them. One such find was a brand new Tork 7102 mechanical timer. It had never even been powered up, nor had any of the knockouts been punched. It was brand new, in it's box.



Anyone who's ever managed a building has seen or set one of these things, knows of their simplicity and reliability. I put a cord and a plug on mine so that I could use it to control the operation of things around the house, and it's probably still in one of my dad's sheds to this day. I'd even reckon that were I to find it, it would probably still work. You control the load by screwing little Pegs onto a wheel with markings indicating time of day within a 24 hour period. White pegs switch the load on, black pegs switch the load off. A special copper wheel (to the bottom-left of the main wheel) allows you to install or remove additional pegs to specify days of week for operation. A simple description of what it could do might be written like this: Turn the load on at 7:00 PM and off at 6:00 AM, Monday through Friday.

Up until now, all of the time definitions within Venturii have been stateful. In other words, they have a start and an end point in time. Day of Week has a Value Interpreter that becomes a 1 at midnight on any day that is selected in it's configuration, and becomes a 0 at midnight on any days NOT in it's configuration. Hour periods have a start and end time, as do Month of Year, Absolute Time Periods, etc. While excellent at making sure plants are watered for 30 minutes every morning at 4:00 on Mondays, Thursdays and Saturdays, these time definitions do not allow you to configure something that happens every ten minutes. They also require something like a comparison to attach commands to them. The comparison evaluates the value of the time period, and then executes different commands based on whether that time period is true or not. I have an amplifier for my whole home audio system that I'd like to make sure gets turned off every day. Everyone in the house knows how to turn it on when they want to listen to music, but no one remembers to turn it off. I don't want to turn it on automatically, but I would like to turn it off automatically as it draws half an amp (~60 watts) when idle. I could set up an hour period and a comparison with a command that executes only when the time period becomes true to turn the amp off at 11:00 pm every night, but it feels a bit clumsy.

Perhaps the biggest motivation for creating the Torx timer has, like all good features, been invented to solve a problem. We have this requirement at work to sign in and out every day by sending an email to the office, telling them where you're working for the day so they know where to start looking if you don't make it home. It's a good idea in theory, however if you haven't signed in by 9:00 am, and haven't signed out by 4:45 pm, the office staff send an email to your supervisor tattling on you for your negligence. The problem I've had with this system is that I work 9-5 or later, sometimes 6 or 7. What's worse is that I'm often IN the office, around a glass wall from the people tasked with policing the sign in board. In latter weeks they've grown accustomed to walking around that corner and seeing if I'm still at the office, but still sign me out regardless of whether I'm done working for the day or not. That system is completely broken. What I've been doing is using Venturii to send my sign in and out emails to the office, which has saved me no end of grief (except one time when I forgot to inhibit it on a long weekend. Oops! haha) Even so, I wondered if someone might notice that my messages to sign in and out came at [exactly] the same time, every day.

A summary of the features of the new Torx Timer system in Decider is this:

  • 24-hour Timing Cycle, perfect for things that need to happen at certain times each day.
  • A single timer can have an unlimited number of Pegs.
  • Each Peg has a fixed time, with microsecond resolution.
  • Each Peg can have a repeat interval, and repeat limit, allowing you to execute that peg's commands at recurring intervals in a single construct.
  • Each Peg can randomly deviate up to a set number of seconds before and/or after the set time, solving the Home Alone problem.
  • Each Peg can have an unlimited number of commands to execute.
  • Each Peg uses the Condition / Inhibitor system for allowing / blocking execution based on other Value Interpreter values.
  • The commands in each peg can be manually executed at the command prompt or from within other objects in Decider.

The Random Deviation functionality has been an idea I've been toying with for a long time, which may see itself emerge in some of the other time definition constructs as well. It solves what I call the Home Alone problem with traditional timers. If you remember the movie, the burglars had memorized when the lights in each house turned on, confirming the vacancies of those premises. By incorporating a random deviation to the set time of any given Peg, you can obtain a more unpredictable result while still maintaining the convenience of automation. Random Deviation has two parameters, number of seconds before the peg time and number of seconds after the peg time to randomly deviate. This allows you to constrain the behavior to something like "Turn on the lights AFTER 6:00 PM but before 7:00 PM." The CONDI integration allow each peg's command execution to require meeting a set of conditions and clear a list of inhibitors, giving you the ability to constrain operation to certain days of the week, times during the year, or only if any other Value Interpreter is a certain value or not a certain value. The repeat feature provides an easy way to do things at regular intervals like resetting counters or sending status emails.

As with many of the features I've come up with, I can't wait to see how other people find interesting uses for them that I had never even considered.

72
Wish List / Intention
« Last post by Cube on September 20, 2015, 01:58:40 AM »
This is where I'd like to host a list of feature requests for Venturii hardware, software and firmware. I'm sure once Mark gets here that he will jump on the "Max Log Gap" feature he's been asking about for months. (I will re-assure you, Mark, it is coming. It's on the road map and I've worked out exactly how I will implement it.) As for other requests, I have a list myself that's three miles long. Having a place to document them, clarify their intent and journal the progress to their achievement is important.
73
Energy Management & Monitoring / Sun XTender PVX-340T Battery in a Solar Application
« Last post by Cube on September 20, 2015, 01:53:41 AM »
I have been using a Sun XTender PVX-340T battery with my solar system. During most days, the solar panel on my roof collects more than enough power to fully charge the battery, and once the sun goes down, the battery supplies power to 2 amps of my outdoor lighting - basically one of my tree beds. The tree bed has three LED spot lights (250mA each @ 12V) and one path light that uses one 11w incandescent bulb (1A @ 12V).

I'm writing this but fear I already know the answer. Since the system was put in, I've had current detection sensors installed on both batteries and the solar panel itself, measuring the amount of current flowing into and out of each battery, and from the panel itself. Only recently did I add a voltage measuring circuit to the VDAC in the garage connected with this setup, and began monitoring the voltage of the main battery I am concerned with, the PVX340T.

I've had the system operating basically on a photocell - when the ambient light level dropped outside below a certain threshold, a relay kicked on, turning on the outside lighting. Once the sun came up the next morning, the relay turned off, and the solar panel & controller took care of restoring charges to both batteries. I do keep mentioning a second battery, but it is not important to this conversation; it is not connected to this load in any shape or form, and the solar charging controller is configured to give 100% charging priority to the PVX-340T, and my measurements with the current sensors seem to confirm this.

We had a week of gloomy weather: Dim, rainy days and dark stormy nights. I was not paying attention, and the system essentially left the load attached to the battery throughout each night. The incandescent bulb in particular, just burned away every last electron that battery had within it.

All of a sudden it occurred to me that this was not good, so I built a voltage monitoring circuit and set up conditions in Venturii to drop the load if the battery voltage reached 10.5 volts, which seems to be the "empty" mark of a 12v battery. Venturii now logs the voltage and current for the battery, but I am finding that it is now dropping below 10.5 volts after only running for about 2 hours whereas before it seemed to last all night without any trouble. Does this mean that my battery is dead? It basically starts rejecting power very early in the day, and dies very quickly at night. Rated as a 34 amp-hour battery, it now seems to be a 4 amp-hour. Can anyone tell me what I already know?
74
Sensors / Re: HC-SR04 Ultrasonic Range Finder - Random Readings in a Tank
« Last post by Cube on September 19, 2015, 04:49:11 PM »
Sigh. A quick search on Google for water softener icons came back to a site describing the exact same solution to water softener salt level reading, using an ultrasonic sensor and all. (Different model, mind you...) Here I thought I figured this one out all on my own. Well, I guess I did - it just turns out I am not the first person to do so... That, and they also have created an icon for depicting the salt tank level. Theirs uses flash though, so I am going to stay away from that and see if I can come up with my own method in HTML5 to make it much more portable and accessible.
75
Sensors / Re: HC-SR04 Ultrasonic Range Finder - Random Readings in a Tank
« Last post by Cube on September 19, 2015, 04:44:38 PM »
Several days running and the readings have stayed within a 3 mm (yes, three millimeter) reading! Tonight the water softener is set to do a regeneration cycle; it will be interesting to see if the salt shifts as a result. Next up I need to find a good way to display this new-found data source; there aren't a lot of water softener icons out there...
76
Sensors / Re: HC-SR04 Ultrasonic Range Finder - Random Readings in a Tank
« Last post by Cube on September 17, 2015, 09:40:36 PM »
Re-checked the power. Voltage at the sensor was 3.4 VDC. Re-wired the power upstream and it's solid as a rock now. Sigh. Good thing to know for next time I guess. And, I can now monitor my salt levels!  :)
77
VDAC-NIM-1 / The VDAC-NIM1: Coming Soon!
« Last post by Cube on September 17, 2015, 06:03:00 PM »
The (second) Venturii piece of hardware, not quite yet finished, is the NIM-1. Based on the Atmega2560 mircocontroller, it will be a one-stop-shop for interfacing with most types of sensors and devices. At this point I just need to review the silkscreen layer (a few things got changed last go-round and I want to make sure they are right.) and get my peer review done. Once those two things are completed, barring any further changes, I'll be sending it off to Oshpark for prototyping. From there, testing and hopefully not long after a small production run! I can't wait to have one of these in my house, as it will solve a LOT of wiring issues that I'm currently enduring.
78
Automation / Best of the Best
« Last post by Cube on September 17, 2015, 05:56:19 PM »
What is the best application of automation to a problem or process that you have seen?
79
Sensors / Re: HC-SR04 Ultrasonic Range Finder - Random Readings in a Tank
« Last post by Cube on September 17, 2015, 05:54:50 PM »
I thought I had it licked. It made perfect sense even, and I had a rational explanation for my findings - except that they were wrong. What I was noticing was that after I'd reposition the sensor, it would usually work fairly well. I've been mounting the sensor to the inside of the lid now as it has the best, widest, unfettered line of sight (and therefore sound) to the bottom of the tank. I only put one bag of salt in this last time because in order for this sensor to work properly it will have to be calibrated, and in order to calibrate it I need to get a base reading from when the tank is fully empty, and then another when it is brimful of salt. After starting with those two values, a simple percentage can be calculated, and I've got my datapoint. Unfortunately, every time I've walked away from the sensor in the tank, it invariably begins to give more and more sporadic readings until it eventually fails outright. The last couple of tests I did, moving the sensor, getting a [better] position and then hot gluing it in place, it would seem to work well (sometimes VERY well) giving fairly consistent measurement readings. I'd think I had it settled when I'd go to check the readings a few minutes later and the sensor is returning 0 cm. Power cycling didn't seem to help. Scratch head.

I started to wonder if it may be conductivity, or capacitance in the hot glue causing some sort of cumulative effect. I was, after all, getting some of the glue directly on electrical components on the HC-SR04, but I always thought hot glue was non-conductive. This time I tried to mount it by the wires only so it effectively dangled inside the tank, pointing more or less at the bottom. Obviously aiming was a lot more difficult like this, but at this point I was a few steps behind aiming the sensor.  Could it also be salt dust in the air? I know salt water is highly conductive... Not sure about salty air. No change. Sensor worked for a while, then eventually pinned back to 2 microsecond round trip times.

Remember, that last go round I took out all the math and just had the sensor send me the round trip time in microseconds. Regardless of where I mounted it, eventually it returned to a round trip time of 2-3 microseconds!  ??? Suddenly it dawned on me, the only way it would be getting such a low reading of distance was if the sound pulse emitting from the transmitter was actually traveling through the PCB and being picked up physically by the receiver. A theory began to form, I was testing the sensor long before the hot glue had solidified. What if, as the hot glue got cooler, it also became harder and therefore made the whole assembly more rigid, allowing physical transmission of sound better? It would explain why it took a few minutes of decent operation for the sensor to begin to get sporadic readings, and once it was fully hardened - remain consistent at returning 2-3 uS times...

To test this theory, I removed my rigid mount, peeled all the hot glue off the sensor (I've been trying multiple sensors along this time too, by the way. They all seem to behave identically, and none of them ideally.) I found a piece of foam, and just put a dab of hot glue on each corner, careful not to touch any of the circuitry and to only [just barely] hold the sensor. Once mounted, I closed the lit again and the readings were rock solid. It made so much sense in my mind, I had conquered this tricky problem. About half an hour later I checked the readings and the sensor was again returning 2 after 2 after 2. Back to the drawing board. 

Could it be orientation? Maybe, for some odd reason, these sensors do not like being mounted facing down? To test this, I detached the lid and just set it on top of the unit, facing upward. Same results. Worked for a while, then got more and more sporadic and eventually dropped and stayed at 2.

I know I had measured power on it before, maybe it's worth checking again. I'm also trying a slight modification to the code wherein I ground the echo pin for a few uS before sending the trigger. Who knows, maybe if there is some capacitive effect at play here that may help reduce the effect?

All this time I am swapping back and forth with two Megas, one in play while the other gets programmed and tested. The more frustrating part is that on the bench, the one [not hooked up to the water softener setup] seems to work reliably, indefinitely, further casting a coin in the coffer of environment as a cause. If environment is to blame though, [what?] Wire length? It's about 8 feet of 4/22. Power? I'll check again. Noise? There shouldn't be any electrical interference inside or near the Water Softener. Operating environment? It seems to do it in open air pointed at the ceiling. This is still very much a mystery. I might have to get someone with a scope in here to see if [together] we can't figure out what on earth is going on with these sensors!
80
Indicators, Displays and Other Human Interfaces / Personal Preference of Display Devices
« Last post by Cube on September 17, 2015, 08:57:35 AM »
There are many types of display screens available to the hobbyist and Maker, each with a purpose and a place. Over time, I've come to prefer some types over others, and I'd like to find out your preference as well.
Pages: 1 ... 6 7 [8] 9