Connect with us

Arduino or...?

Discussion in 'Home Power and Microgeneration' started by j, Nov 28, 2012.

Scroll to continue with content
  1. j

    j Guest

    I'd like to automate my solar heating system. So,I'll need a little
    control logic that reads some temps and switches on a fan and possible
    some servos.

    It's been a while since I've looked at the options, but I see Arduino is
    readily available with a variety of hardware.

    Recommendations for control logic, sensors, or other hardware? Arduino
    or something else?

  2. mike

    mike Guest

    Here's a strategy that works for me.

    Use a microcontroller to do the low-level hardware interfaces and real-time
    Interface it with a RS-232 port. That makes that part pretty easy.
    You have lots of choices for hardware. I use PicBasic pro and the
    16F877A processor, cuz that's where I started and see no reason to change.
    Starting fresh today, the Arduino looks attractive. But pick
    something that has a compiler language you can live with.
    I don't have the patience for C, and that limits my choices.

    I do the heavy lifting on a PalmIII connected to the PIC
    serial port. There's a free basic-like language called
    "dialect" that makes it easy to get a GUI interface with
    touch. Do all your floating point math and string processing
    and data logging in the Palm.
    PalmIII's can be had at garage sales and scrap dealers
    for under a buck.

    Here's where it gets interesting. If you want to switch
    from the palm to a PC, all you gotta do is use a usb/rs232 dongle.
    You don't have to change ANY code.
    Ditto for wireless. I can plug on RS-232 to Bluetooth dongles
    and the whole thing goes wireless with ZERO changes in the code.
    You don't have to know anything about USB or Bluetooth or nothin'.
    As a result, you can use a microcontroller with much less horsepower.
    Don't discount RS-232 just because it's old. It makes a great
    common denominator.

    This is a sample of what you can do very easily on a Palm. This
    monitors the gas furnace:

    One rule I live by is, "don't ask a question if you're not
    gonna do anything with the answer."
    With home automation, there's the temptation to measure
    and control everything.

    A few years ago, in a fit of frugality, I sought to reduce
    my energy consumption. Another Palm program times the IR
    pulses coming out of the smart utility meter and graphs
    energy use.
    It was fun to watch the fridge or the water heater or the
    furnace blower go on and off...for about a week.
    Then, I realized that taking shorter showers uses less
    electricity. I don't need to measure the water heater
    to know that. If I'm already taking the shortest showers
    I can tolerate, knowing the power consumption is irrelevant.
    Most of what I needed to know was just plain common sense
    and didn't need any monitoring.

    Same goes for the furnace monitor in the pix referenced above.
    The program has the ability to measure inside and outside
    temperatures. So, yes, when the outside temperature is
    lower, the furnace runs longer. About the only interesting
    thing I learned was that there's about a three hour time
    lag between outside temperature and the furnace duty factor.
    I scrapped the thermometer interface.

    There's a thread currently raging in comp.arch.embedded on the subject
    of AVR and C.
  3. Jim Wilkins

    Jim Wilkins Guest

    Can you post a link to it? Googling "dialect" + computer language
    terms brings a flood of irrelevance.
    I solved that by replacing the shower head with an extended-length
    sink spray, which shuts off when released. The head end is a
    replacement hose for one of the big multi-function shower sprays that
    does everything EXCEPT shut off automatically when released. The
    threaded ends fit a brass coupler, though they don't look like pipe
    threads. I checked in the store. Anyway if it leaks a little, so what?

    A sink spray hose also converts a (new) pump bug sprayer into a shower
    that operates with water heated on the stove. I replaced the skinny
    outlet pipe with 3/8" copper tubing. Have a separate bucket to temper
    the hot water because it may be difficult in the tank. The 2 gallon
    sprayer I bought seems a good compromise between run time and handling
    awkwardness in the slippery stall, though I have to refill it at least

  4. mike

    mike Guest

    OOPS! I screwed up.

    Dialect is the similar interpreter for the Windows PocketPC/Wince.
    Also runs on windows desktop PC.

    The Palm program is called HotPaw Basic interpreter v 1.4.7(b0)
    Works up thru PalmOS4. I don't remember whether it has issues
    with PalmOS5 or just won't run at all.

    You're also gonna need mathlib.prc

    This stuff is very old and there are lots of obsolete/broken links.
    Getting harder to find, so save a copy somewhere you can remember.

    Pick up a PalmIII whenever you find one under a buck. They make excellent
    user interfaces for hobby projects. Cheaper and easier to use
    than a dedicated character LCD display. Far more versatile.
    You can get crude wireless via the infrared serial port. Just pull
    the IR transceiver module out of a dead palm and cobble it onto
    your microcontroller.

    The PalmIIIC has color and backlight, but I never figgered out how
    to turn off the backlight. Makes it unsuitable for battery-powered
    projects that need to run for very long. The plain PalmIII is mono
    but runs a lot longer on battery.

    Problem with any of these is that, when the battery goes, so does your
    program/data. You can use the PC to reload thru a cradle, but I find it
    easier to have a PDA on hand with a flash card.
    Just reload the palm thru the infrared.

    Handspring Visor is another alternative. There's a flash memory module
    for it so you can reload it when the battery goes dead and the ram
    gives up its bits...but they're rare.
  5. Jim Wilkins

    Jim Wilkins Guest

    At several places I worked the engineers preferred obsolete
    front-office laptops to PICs etc to run experiments. Their power
    consumption isn't that high if set up right. My late 90's Compaq
    Armada draws 7W at idle, 12-13W running a program. My dual-core Dell
    Latitude with Windows 7 takes ~14W idle, low 20's running with the
    display off, for example after waking from Sleep to record TV. Both
    can use an Auto-Air adapter and an old car battery to log data for a
    long time, then switch to AC for data-crunching with the full power of
    a spreadsheet on a large display.

    The engineers had the funds for special add-ons such as CAN converters
    to communicate with electric vehicle controllers, but I cobbled up a
    similar I2C interface using the printer port. Cardbus plug-ins with
    extra serial or USB ports are cheap. I'm using this to add USB3 to a
    5-year-old machine, limited only by hard drive speed:

    National Instruments made data acquisition cards for laptops:
    or you can buy external ones like this:

    The Radio Shack 22-805 PC Link Multimeter was a great data acquisition
    device for a laptop, I don't know if an equivalent is still available
    new. It can record the current in 240V house wiring with a clamp-on
    probe and with its optical isolation is safe to wire into a circuit,
    such as the current monitor in a battery tester.

    If the hard drive is formatted FAT32 the laptop can dual-boot DOS and
    Windows 2000 or XP and both can read and write the data files. The
    advantage of DOS is very low overhead, only the clock ticks, and full
    unhindered access to the I/O ports, though USB is a problem unless
    your language can configure it as virtual serial ports. The printer
    port appears as one 8-bit read/write Data register and smaller
    write-only Control and read-only Status registers. These ex-office
    machines invariably had Windows and MS Office already on them or
    freely available to reinstall.

  6. j

    j Guest

    Damn Thunderbird...

    Meant to follow up,not reply to OP. Sorry.

    I've been mulling all this over. Thanks for the detailed reply.

    I don't mind the pseudo C,and the Arduino is gaining traction.

    This is an interesting way to go.
    That is way cool.
    Serial is good. I like the bluetooth.

    Arduinos come with USB. I think USB to Wifi is better as the range is
    better and so is the possible security.

    I know about web servers and web programming, so what I am thinking
    about is a little raspberry pi lamp (linux,apache,MySQL,PHP) server. The
    lamp gives you higher level languages to work in. That could talk to any
    Microcontroller on the WiFi and display the data as a web page. The web
    page could talk back through the server and send or receive from any of
    the Microcontrollers. I see that Arduino can talk X10, so that leverages
    a huge amount of cheap dimmers and switches and such.

  7. Jim Wilkins

    Jim Wilkins Guest

    I like the quick and easy Arduino c compiler too, but it encourages
    writing and testing in short pieces which can eat into the program
    memory's limited write cycle life.

    I don't like the low A/D converter resolution for serious

  8. mike

    mike Guest

    I'm sure professional C programmers don't have the problem...but
    for the occasional hobby program, I like BASIC-like languages.
    If I have the algorithm right, I can usually make it work easily
    with BASIC. With C, I spent more time being hassled by the compiler
    than I did debugging the algorithm. I exceeded my frustration
    limit and attention span.
    I went back to BASIC.
    Yes, it's clearly my fault, but the result is the same.
    With the breadboards and single-layer PCBs that fall within my
    attention span, I find that 10-bits is more than sufficient resolution
    to measure the system noise. ;-)
  9. Jim Wilkins

    Jim Wilkins Guest

    Agreed. I started with Pascal on a mainframe, then wrote a lot of
    QBasic under DOS on the lab test systems I mentioned. QBasic has
    nearly the same structure as c but it's wordier and requires explicit
    definitions of functions and variable types, which makes it easier to
    understand and modify two months later if you aren't a full-time

    I'm still looking for a good open-source replacement for QBasic with
    its simple power and interpret/compile flexibility and a real Windows
    interface. Visual Basic dropped the INP and OUT statements that talk
    to the hardware registers, so I can't write low-level device drivers
    in it.
  10. mike

    mike Guest

    Not clear what you seek. I switched my non-gui stuff to freebasic.
    It has a real windows interface, but doesn't create an app with a
    Windows GUI.
    The base program is spartan, but fbide.exe is the GUI you want.

    Gambas3 looks interesting. It can create a windows GUI (small w) but
    runs on linux.

    Visual Basic dropped the INP and OUT statements that talk
    Have you tried this?
    I can't recall whether I've tried it with win7, but it worked well in XP
    when called from VB6.
  11. Curbie

    Curbie Guest


    I use the Arduino also (more about that later), but Mike's post caught
    my eye, if you're way more comfortable programming in BASIC are not
    comfortable programming in C, I'm told there are other "Arduino like"
    alternatives which use BASIC that have their supporters, I've only
    ever used the Arduino.

    The Arduino we did has an LCD, 4 control buttons, 3 DS18B20
    temperature sensor and controls:
    1. Heater control (AC electric heater; SSR control - on/off)
    2. Water feed control (DC motor fixed speed pump - on/off)
    3. Beer feed control (Parastaltic pump run by variable speed stepper
    motor - step pulses or motor winding phases)
    4. Reflux control (solenoid controlled valve - on/off)
    5. Alarm (relay control - on/off)
    6. Alert (piezo buzzer - pulsed to create beep, or on/off

    Here's a picture:

    It's open source and would make a fine differential controller as is
    if you rewrote the control software section.

    I can find the on-line link if you're interested, there is also an
    custom sheild board for all the I/O avaliable.

  12. Curbie

    Curbie Guest


    It's a BIG programming No-No, to address hardware directly in Windows,
    you're support to API calls, I may still have a VB serial port API
    Library laying around somewhere on my system if you're interested in

  13. j

    j Guest

    I don't have a problem with C. It's just more tedious to have to compile.
    I'm impressed! And I like the off the shelf box you used!
    I see the 10 bit A/D has no problem reading temps to a .1F. I don't need
    that much accuracy.
    Sure. I'm juggling money at the moment and it'll be a week before I buy.
    It's like Summer!

  14. Curbie

    Curbie Guest


    I haven't gotten around to a diiferential controller yet, but it's on
    the todo list.
    The DS18B20 temperature sensors have a .5C or 1F accuracy with a 10
    bit resolution and cost about $1.75, the point being, that they're not
    that much more expensive for those that don't need that much accuracy
    and resolution, but have the accuracy and resolution for those who do.

    It's pretty easy to convert the same controler for or between
    different funtions we use them for fermentors, incubators, feedstock
    processing, all with a software change. (the funtion control section
    of the software) The software that controls all devices is always the

  15. j

    j Guest

    Where do you get them for that price?

    What I would like to do is run cat5 throughout the house and outside
    also. Is there a limit on how far you can run a one wire?

  16. Curbie

    Curbie Guest
    All the parts links are in the manual. Which is quite good.
    10 meters for the temperaure sensor one wire bus (I think, it's been a
    while) I up to 8 sensors per bus (I think).

  17. j

    j Guest

    Oh man, I love this place, the prices are right, and they got a lot of
    stuff. It's a builders paradise.

    I've got a half dozen things I'm going to get from them now!

    Thanks, I'll look into it more.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day