0

I want to use my programing skills to make my day-to-day life easier, to do this I want to be able to program in my appliances like alarm clock or microwave or refrigerator, air conditioner etc, wish they had firmware that I could flash with my program to control them and adjust their work to my liking.

Right now I am limited with desktop or laptop you know when power goes down all you done is not there anymore.

I know in school they show how to program basic clock on electronics class with some 3rd party programming language, currently I assume there are 10's of different programming languages for devices and I don't want to learn different language for each device, wish there was like API on each device that I can use with whatever programming language I normally use e.g. PHP.

I am basically looking for way to adjust /expand functionality of real life standalone electronics (without connecting them to PC or using virtual analogue) learning programming language company used when created it.

Are there any appliances that support this or is there some language converter I can add to make it possible?

P.S. Currently there are Raspberry PI computers for $40 bucks that fit in hand perhaps I can create my own say alarm if I put it in a box and attach speaker to it and then program is with using PHP or it's currently not possible?

Not interested in inventing anything, just wondering if there are ready tools / ways to customize application firmware without learning their specifics today?

2
  • To start, you'll need a degree in EE or the equivalent training and skills. Commented Nov 12, 2014 at 4:58
  • As a simpler alternative to your Raspberry Pi, you can also look at netduino.com/netduinoplus2/specs.htm (which doesn't have an o/s, which might make things simpler). You can program it in C# or C and it is intended for the Internet of Things.
    – Mawg
    Commented Nov 12, 2014 at 9:16

3 Answers 3

1

This is a quick article about the relationship between APIs and hardware.

Generally, if you are accessing hardware directly, you would generally use a C or C++ driver. You might raise the question: how do all the other languages access the hardware? They utilize the C or C++ compiled driver.

EDIT: One of the commenters provided a list of high-level language compilers and interpreters for microcontrollers, so my statement was outdated. These would give you the options of using Embedded Java, Python, Lisp, etc. It would be interesting to investigate if each of the interpreters is tightly coupled to a processor, or if it is as simple as a recompile by processor.

Does this mean you need C and C++ for anything you do? Yes and no. It depends upon the APIs available to you. A C driver may have a C# wrapper around it, and you can do what you need in C#! I was on a C# project, and we had a couple C# wrappers for C++ libraries. However, if you are really interested in programming specifically for the hardware, you will not be able to use an interpreted language (as is PHP) or a non-native language (Java). You will need to run native, as compiled C or C++ does.

And this really assumes that you are creating your own clock, light, microwave, etc. I suppose a Raspberry PI machine would do -- or would be an accessible overkill -- for what you want to do. If you want to control a commercial product, the manufacturer needs to provide you an interface to manipulate their product.

8
  • That provided that device knows how to process C or C++ or anything else, i am not aware of any common household device that do, doubt they put this tech in microwave... guess this is possible only for complex devices and will be a lot different from device to device. Commented Nov 12, 2014 at 2:04
  • 2
    I added some more clarification... and compilers process C and C++, not the devices themselves. So yes, you are right that your microwave does not process C and C++. And you need to be working with a device that gives you the interface to program it, like the Raspberry PI machines you mentioned -- from those you can create a clock or a music player. But your microwave does not provide you an interface to program it -- that would be unsafe. Commented Nov 12, 2014 at 2:08
  • 1
    There are a number of high level languages on a chip (either as an actual chip, or other code) that are interpreters on the system. See Survey of High-Level Language Interpreters/Compilers for Microcontrollers... I'm fairly sure there is a C interpreter on a chip somewhere (that you are writing C that is interpreted by the microwave rather than compiling it).
    – user40980
    Commented Nov 12, 2014 at 2:28
  • Thanks for answer. Perhaps we can use microwaves jack where they plug control panel (buttons) to control it. This way we not directly working with hardware, but still can control their device using controls manufacturer built in themselves. Say we have Rasberry PI with control software C++ and we link with microwave controls jack trough simple adapter that simulates key press based on Rasberry PI signal and we can customize also from C++ what electronic links it will lock to make it universal... Commented Nov 12, 2014 at 2:29
  • That will be a good starting place if the interfaces aren't soldered together. At that level, I would guess you wouldn't be sending C or any other language commands, but electrical signals. Commented Nov 12, 2014 at 2:30
1

Rather than trying to modify the firmware of devices, and alternative is to harness what is already in place. As you say, a small single-board computer is a good solution.

Try a Google search on Arduino. These boards are cheap, and are designed to control lots of IO lines. Programming in C or C++ is the norm and you are working with bare metal - there is no operating system. There is a SE Arduino community.

Compared to the Rasberry PI, Arduino has better IO capabilities and lower power consumption, but far less RAM and CPU power. You can run a web server on Arduino, but only just. HTTPS and a solid authentication scheme are probably impossible, meaning you need something more powerful to front it to the Internet.

Don't discount controlling modern electronic devices via their IR remote port. I control my heatpump across the Internet using an Arduino to synthesise the IR stream. This is a great solution, as there is no modification to the device, and no danger of zapping yourself accross the mains.

There are some crossover boards appearing: the Arduino YUN has both an Arduino IO processor and a Linux capable processor. This would be ideal for tasks where you need to publish a secure web server. You can program in PHP under Linux and control the IO from the Arduino.

0

You should also take a look at X10, which has been around at least 25 years to my knowledge. Back in the day I used to just power deceives on and off, but it has grown to be much more sophisticated since.

X10 is a protocol for communication among electronic devices used for home automation (domotics). It primarily uses power line wiring for signaling and control, where the signals involve brief radio frequency bursts representing digital information. A wireless radio based protocol transport is also defined.

X10 was developed in 1975 by Pico Electronics of Glenrothes, Scotland, in order to allow remote control of home devices and appliances. It was the first general purpose domotic network technology and remains the most widely available.1

Although a number of higher bandwidth alternatives exist, X10 remains popular in the home environment with millions of units in use worldwide, and inexpensive availability of new components.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.