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
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
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.
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.1Although 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.