All times are UTC + 8 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sep 28th, '11, 10:58 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
It turns out this stuff is pretty easy to learn.

Anyone thinking about getting involved should just jump right in.

I went with PICAXE, but there is an open source version called arduino, and no doubt there are others.

PICAXE was a bit cheaper, but Arduino has lots of boards called shields that do all kinds of things that plug right in to your main board and so might save some time and make things easy. But...

PICAXE also has a board that takes Arduino shields so who knows. At some stage you just have to pic a side. (that's my first electronic's joke)

So you start with a chip.

My first one ,an 08M has 8 pins or legs.

you can connect stuff to the pins and send the chip some input (from say a switch or thermometer) and you can connect other stuff to other pins and have the chip control it. These would be called outputs. They might include motors for fans, opening and closing vents in a green house, or turning on and off a pump or tap.

The chip in the middle does some thinking and compares conditions or whatever you want it to do.

A program might look something like this. (this is obviously in english, not computer speak)

Code:

START

     have a snooze and count sheep for 5 minutes
     
     Check the temperature probe connected to pin 1
          if it's above 30c turn on a fan connected to pin 2
                  then go back to START
          if its below 28c turn off the fan connected to pin 2
                   then go back to START
          otherwise, do nothing and just go back to START
END

     


you have to add some additional electronics stuff between your chip and the fan. Basically you use the output to turn on a switch, that turns on the fan, but it's pretty straight forward stuff.

The real code for the bit that does this...

Check the temperature probe connected to pin 1
if it's above 30c turn on a fan connected to pin 2


might look more like this...

If TankTemp > 30 then High pin2


"TankTemp" is a variable like "x" in an equation. It's something I would have created earlier with the symbol command, and would store the number being read from the temperature probe connected to pin 1

Obviously there's more to it than that, but generally speaking that pretty much sums it up.

There are an amazing array of input devices like temperature probes and pressure switches and many cost only a few cents.

There are an equally amazing number of output devices like motors and lights and alarms and little screens that can show info so you can see things like temperatures etc . Things like screens can cost as little as $7 AU.

There are little project boards that you can build that enable radio communication from one project to another that cost around $60 for the pair, and there is even a net server project that could be used to check up on your AP system from work over the internet.

So far everything I've been able to think of is doable, and I can think of a lot of stuff.

There are some people on BYAP who already know this electronics electronics stuff, (I'm in week 4 of my education so don't know very much at all) so if the rest of this forum is anything to go on, there should be stacks of people willing to help if we get stuck.

Add to your aquaponics obsession with electronics :)


Top
 Profile  
Reply with quote  
    Advertisement
 
PostPosted: Sep 28th, '11, 11:43 
Site Admin
Site Admin
User avatar

Joined: Mar 12th, '06, 07:56
Posts: 17803
Images: 4
Location: Perth
Gender: Male
Blog: View Blog (1)
A bit like the old Basic programming. I remember that from the old days when I had a sinclair zx80..

Now there was a computer, 1Kb of ram and plugged into your tv...

Attachment:
ZX80.jpg
ZX80.jpg [ 87.11 KiB | Viewed 8149 times ]


Top
 Profile Personal album  
Reply with quote  
PostPosted: Sep 28th, '11, 12:12 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
nice :)

Love the name.

And yes the language is a variant of basic and is very simple. Ardrino uses a language called C which is a little more complex, but not so much that it should put anyone off.

I forgot to mention how the PICAXE chips are programmed.

You download a program editor (free) and buy a usb cable that plugs into a headphone jack that you add to your board. The first 2 pins on the chip are connected to the plug, and when you want to change your program, you plug it in, write your code, then click something that uploads your new code.

The operating system and everything required to understand the program is built into the chip. So when you turn on your project, it just starts running the code you put in and it does what ever you told it to do.

you can get feedback to your computer to see what's going on in the chip etc in the programming software.

I'll start a proper project and post about it so anyone interested can follow it's progress.


Top
 Profile  
Reply with quote  
PostPosted: Sep 28th, '11, 17:00 
Bordering on Legend
Bordering on Legend

Joined: Apr 12th, '11, 21:07
Posts: 252
Gender: Male
Are you human?: yes
Location: Australia
hi BullwinkleII

This is a great and timely thread that you have started.

Please keep us informed of your projects and progress.

I was wanting to build a four way timer to control four relays that in turn controls
four 24vac reticulation valves.

Would I need four 08M chips or could one do the job?

cheers Lou


Top
 Profile  
Reply with quote  
PostPosted: Sep 28th, '11, 20:05 
Almost divorced
Almost divorced
User avatar

Joined: Feb 25th, '07, 21:27
Posts: 1103
Location: Middle Swan, Perth ,W.A
Gender: Male
how much have you spent so far bullwinkle??
what sort of docmentation comes with the chip
how hard is the board making (this bit is where i get worried )

and got any pics?

Cheers
pete


Top
 Profile  
Reply with quote  
PostPosted: Sep 28th, '11, 20:13 
Legend Member
Legend Member
User avatar

Joined: Jun 22nd, '11, 17:01
Posts: 527
Gender: Male
Location: Central West NSW
excellent thread.. thanks for the explanations. Visited some of the picaxe forums a while back and chucked the idea into the too hard basket but you've got me interested.


Top
 Profile  
Reply with quote  
PostPosted: Sep 28th, '11, 20:37 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
trout wrote:
hi BullwinkleII

This is a great and timely thread that you have started.

Please keep us informed of your projects and progress.

I was wanting to build a four way timer to control four relays that in turn controls
four 24vac reticulation valves.

Would I need four 08M chips or could one do the job?

cheers Lou



I have no idea :)

But I'm sure someone else will :)

If they dont I'll figure it out within a few days for you. That's the kind of thing worth knowing :)


Top
 Profile  
Reply with quote  
PostPosted: Sep 28th, '11, 21:18 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
Delgrade wrote:
how much have you spent so far bullwinkle??
what sort of docmentation comes with the chip
how hard is the board making (this bit is where i get worried )

and got any pics?

Cheers
pete



all you need to get started is..

a chip 4$au
a stereo headphone jack < $1
a resistor
and a cable $10 or so I think

I bought mine locally and it cost me $22 (self assembly) but I'm told it takes around 8 days for delivery for stuff bought from the PICAXE site PICAXE.com

These people are legit, have a huge user base, and deal a lot with the education system within the UK so personally I would have no problems with buying stuff directly from them. Having said thatI havnt bought anything from them yet because I cant wait for any new project I'm involved with so I happily pay 4 times as much as I need to :)

I'd recommend http://www.picaxe.com/Hardware/Starter- ... rter-Pack/ get you started painlessly if you want to learn how to solder.

but you can look at the manuals and build the same circuit for a lot less.

the only real advantage is it comes with a circuit board with little pictures on it to tell you were parts go, but there are only 3 or four parts so it's easy enough to work out on your own if you want to make it with bits of wire and a potato to stick all the bits into to hold them in place :)

if money is no object ($100au or so) I'd buy the development kit because it can take any chip they make, and already has some stuff like lights and switches built in. This means its a bit easier to prototype stuff because you can be sure that the reason your code isnt working isnt because you have a loose wire, but is in fact because your code doesnt work.

but I bought a 08M protoboard and a small breadboard. $30au I think

A breadboard is like that tortilla link, but is made of plastic, and allows you to add components and wire connectors without soldering. Not really suitable for permanent real world projects but fine for prototyping and learning.

The first thing I did with my little protoboard kit was to solder some pins onto it so it would plug into a little breadboard. (I think you can buy other kits that dont require soldering)

This enabled me to do all kinds of stuff. I think the most complicated thing I've made so far was a motor that changed speed based on a volume knob, and it also had to be at a certain temperature. I called it a mrs Bullwinkle proof switch, because her hands were too cold to activate it (because I set the threshold so that she couldn't :)

Here's a pic of the proto board (sticking up) plugged into the breadboard, (white thing with holes). All the white wires on the proto board are just to connect the pins of the chip to the pins that plug into the breadboard.

The circuit on the bread board is just a transistor that allows me to power a 12 volt motor, with the tiny power that comes out of the chip. The transistor (little black thing on the breadboard) acts as a switch and amplifier.

Apparently that's what transistors do.

So I have a second battery pack powering the motor (pretending to be my big 12 volt backup battery in my aquaponics system). And I can then control the motor's speed by the voltage supplied to the transistor. And I can control that with code.

not bad for only a few components and some wire.


Attachments:
120 Things in 20 years -Electronics - motor control via transistor.jpg
120 Things in 20 years -Electronics - motor control via transistor.jpg [ 22.24 KiB | Viewed 8101 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sep 28th, '11, 21:22 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
jono81 wrote:
excellent thread.. thanks for the explanations. Visited some of the picaxe forums a while back and chucked the idea into the too hard basket but you've got me interested.


Yeah, I joined about a year ago and kept putting it off, but it turns out to be pretty easy.

I'll help with whatever I can, and there are some others on here that have some actual knowledge that will no doubt discover there is an electronics section soon, and then be as helpful as everyone on this forum tends to be.

Jump on in, the waters fine.


Top
 Profile  
Reply with quote  
PostPosted: Sep 28th, '11, 21:28 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
trout wrote:
hi BullwinkleII

This is a great and timely thread that you have started.

Please keep us informed of your projects and progress.

I was wanting to build a four way timer to control four relays that in turn controls
four 24vac reticulation valves.

Would I need four 08M chips or could one do the job?

cheers Lou


Looking at my notes I think there are actually 4 output pins on the 08M chip, but if I'm wrong, it would only be a case of using a 14 pin chip, rather than 4 X 8 pin chips. It would cost less, and all your code would be in the same place.

Just keep in mind this is day 28 of my electronics education.

I should add that to my signature as a disclaimer :)

DONT FOLLOW ANY OF MY ADVICE WITHOUT CHECKING WITH SOMEONE WHO KNOWS :)


Top
 Profile  
Reply with quote  
PostPosted: Sep 29th, '11, 10:59 
Bordering on Legend
Bordering on Legend

Joined: Apr 12th, '11, 21:07
Posts: 252
Gender: Male
Are you human?: yes
Location: Australia
Quote:
Looking at my notes I think there are actually 4 output pins on the 08M chip, but if I'm wrong, it would only be a case of using a 14 pin chip, rather than 4 X 8 pin chips. It would cost less, and all your code would be in the same place.


hi BullwinkleII

I spent last night reading the manual and it's just amazing how versatile these things are,
I can see a lot of fun to be had.

It would seem the single 08M will do the job but may be worthwhile attaching it to
a AXE033 as the 08M clock is not very accurate.

Quote:
The PICAXE microcontroller works at a nominal 4MHz, but due to device
manufacturing tolerances there is likely to be a drift of a few seconds over long
time periods (e.g. a day). Note that the Serial LCD/Clock module (AXE033) has a
precision clock and ‘alarm clock’ function that can be used to trigger the PICAXE
at predefined interval or at certain time/dates with much greater precision. The X
parts can also be linked to the i2c DS13097 real time clock.

(pg 104 manual 1)
cheers Lou


Top
 Profile  
Reply with quote  
PostPosted: Sep 29th, '11, 14:33 
Newbie
Newbie

Joined: Mar 24th, '11, 11:50
Posts: 41
Gender: Male
Are you human?: YES
Location: Tasmania
Oh man, I'm like a kid in a candy shop with this stuff but I do not have time to do this. I will have to live vicariously through you on this thread :thumbright:


Top
 Profile  
Reply with quote  
PostPosted: Sep 30th, '11, 00:35 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
trout wrote:
Quote:
Looking at my notes I think there are actually 4 output pins on the 08M chip, but if I'm wrong, it would only be a case of using a 14 pin chip, rather than 4 X 8 pin chips. It would cost less, and all your code would be in the same place.


hi BullwinkleII

I spent last night reading the manual and it's just amazing how versatile these things are,
I can see a lot of fun to be had.

It would seem the single 08M will do the job but may be worthwhile attaching it to
a AXE033 as the 08M clock is not very accurate.

Quote:
The PICAXE microcontroller works at a nominal 4MHz, but due to device
manufacturing tolerances there is likely to be a drift of a few seconds over long
time periods (e.g. a day). Note that the Serial LCD/Clock module (AXE033) has a
precision clock and ‘alarm clock’ function that can be used to trigger the PICAXE
at predefined interval or at certain time/dates with much greater precision. The X
parts can also be linked to the i2c DS13097 real time clock.

(pg 104 manual 1)
cheers Lou


I was worried about the time accuracy issue with the feeder project, but then came to the conclusion that it doesnt really matter.

In fact I'm starting to think that rather than working to a 24 hour feeding plan, it might be better on the system to have a 5 hour feeding plan, and then reset and start again. Or even a plan based on feed delivered within the last 5 hours regardless of what time is is.

I have no idea about feed timing etc, but it seems it might be better for water condition if you fed the same amount of feed over 20 feeds in a day rather than 2.

It would spread the nutrient load out over the entire day.


Top
 Profile  
Reply with quote  
PostPosted: Sep 30th, '11, 06:39 
Xtreme Contributor
Xtreme Contributor

Joined: Sep 29th, '10, 16:44
Posts: 211
Gender: Male
Are you human?: yes
Location: Warnbro , Western Austarlia
Hey BW , I'm a total Neanderthal when it comes to this sort of stuff , so hopefully you can set me straight .

Do you think it would be possible to set something up to opperate my roller shutters when I'm away ? Maybe open during the day and close at night , so as to create the illusion that someone is home .

Cheers Al


Top
 Profile  
Reply with quote  
PostPosted: Sep 30th, '11, 10:11 
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Mar 26th, '10, 20:46
Posts: 5404
Location: South Australia
Gender: Male
Are you human?: Yep
Location: South Australia
It's a bit off topic (aquaponics wise), but yeah that kind of stuff is pretty easy

chip to work out the time, and a relay handles mains power to your roller door

page 8 http://www.picaxe.com/docs/picaxe_manual3.pdf

only 4 components

the two things on the right in that diagram would be your mains power wires

you could add a photo-resistor to make it work with day and night for a few cents.

The people at the picaxe forum will help you out


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC + 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.062s | 19 Queries | GZIP : Off ]