Electronics - introduction to PICAXE - 08M

"So what so exciting about a programmable microchip?" I hear you ask.

"Lots.", I hear me reply. And I've just had a tiny glimpse of what they can do.

This is a rough outline of how they do what the do so well.

You buy this little bit of plastic with some pins sticking out of it. This one costs around $2. It's a little computer that can read stuff connected to it, and respond to the outside world by manipulating stuff connected to it. Inputs and outputs.

It's surprisingly powerful. In fact is has the same processing speed as my first computer.

I never looked in side my first computer, but I doubt that this was all there was inside.



My little chip has 8 pins.

Each of them does interesting stuff.











The top two pins are to connect your power lines.

One + 4.5 volts, and one - 0 volts.











Useful force can be applied to a problem, because of the difference in these two voltages. A rock sitting on top of a hill is stored force, because there is a downhill. If there were only uphill, or only downhill, you'd just have regular powerless rocks. But combine an uphill with a rock on it, with a down hill, and we have some potential energy.

So useful force exists because we can tap into the difference between these two voltages.

The next two pins are so your chip can chat with a computer like the one you are sitting in front of now.

I dont know how that stuff works except to say a cable goes from these pins to a computer, and as a result you can successfully store instructions on the little chip.

You can also see some stuff on your computer screen so you can tell what's going on in there.

But more about that later.

The bottom four pins are the interesting bit. They allow inputs and outputs.

Within this chip they can be referred to by your instructions as C.1, C.2, C.3, and C.4.









What this allows you to do is write a program that controls the temperature in a grow house with  something like this...

Start
Check the temperature from a thermometer connected to pin C.1
         if its too hot, turn on a switch (connected to a vent fan) connected to pin C.2          otherwise don't worry about it
         wait a few minutes and count sheep for a bit
go back to the start and recheck over and over again for ever, in case the weather has changed


That's not a real program or anything, that's just the kind of thing you might ask of one.

I wish that was real programming. Then I'd be an expert, because that's just my thoughts on any regular day.

I count a lot of sheep.

But you can also do a lot more than that. For instance just on the subject of keeping your grow house temperature sane, you could take a temperature inside and out, compare them, decide which is the better temperature, and run the fan only if its an advantage to do so. After all, if it was hotter outside than in, and you blew your too hot air out, it would be replaced with even hotter air from outside. Perhaps you could choose to draw in air from somewhere cooler.

I can think of a dozen different things I could control in the grow house alone.

The really cool thing, is there are a stack of incredibly inexpensive components that you can buy, that are light sensitive, sound sensitive, distance, moisture, GPS, touch, vibration....everything you can think of. And they can all be attached to a pin, have some decisions made, then those decisions can control things like lights, motors, switches, locks, pumps, robot arms, clocks, electric toothbrushes, toys, lawn mowers, and everything else you didn't think of in that first bit, where I got you to think of everything.

No comments:

Post a Comment

Popular Posts