Project help. Temp sensor + LCD

micky01

New Member
Hey guys,

Ill try and keep this as simple as possible.

I’m currently working on a project. It’s basically a home made soft drink dispenser, similar to one of the ones you see behind the various fast food outlets. What I'm doing is having 4 valves controlled by 4 solid state relays. These relays are controlled by a picaxe which connects wirelessly (those 433 transmitters and receivers from jaycar electronics) to another picaxe to control these valves via a "remote control" sort of connection.

So that’s a very quick run down on what I’ve planned. Now here is the part I'm having problems with. I have 3 temp sensors, 2 Dallas ds18b20 and a ds18b20+. I also have these connected to the Picaxe (28X) which will send this data over to the other picaxe (28X) wirelessly also. I understand you can't execute 2 lines of code at the one time, but can someone give me a basic idea of what I need to write so that I can control these relays as well as send the temp's from the sensors back to an LCD (same as the picaxe website’s) screen when not controlling these valves.

For example, when controlling the valves, the LCD screen changes to a message say “Now dispensing COKE” and when it’s not dispensing it should display on the top line “Current temp’s:……” and on the bottom line “Please select drink” or something similar. I have got no idea where to start, but that’s all I really need – just a start as I have some knowledge of picaxe/picaxe programming.

Any help would be great.

Cheers.
 

craigcurtin

Senior Member
OK, Here we go.

Firstly once you switch a relay on (from an output pin on a picaxe) it will stay on until you turn it off.

Make sure that you have relays that can be driven by the line level outputs of the Picaxe and you should have some form of noise supression etc in there also.

You will also need to ensure that if this is 240v stuff you follow all the standard safety precautions.

In terms of interfacing to a DS18b20

Readtemp 1, b0

Where 1 is the port the sensor is on and B0 is the temporary variable to hold the returned value

You can have multiple of these
Readtemp 1, b0
Readtemp 2, b1
Readtemp 3, b2

Then based on the results of these you can do some comparison testing to then turn on or off your relays and/or put messages out to the LCD screen

High 1 ' turn on relay 1
Serout 2,N2400, "Relay 1 is on - enjoy your drink)

Does that answer your question ?

Craig
 

micky01

New Member
Hi Craig, thanks heaps for the info mate.

Yep I understand all that, helped me out heaps. The 240v isn’t an issue as the valves are controlled by 24VAC adaptor and I've also got the relay control worked out fine in terms of noise suppression etc.

I understand how I will obtain all the values from the temp sensors and how to control the relays; it’s the part where I want to send this wirelessly and display it on the LCD screen, not at the same time, but with the same picaxe. So I have only 2 picaxes communicating with each other.

So ill give some examples of how the system will run. I’ll indicate the part where I’m struggling how to write the code. (Picaxe 1 = Controller and Picaxe 2 = Dispenser picaxe)

User turn’s on controller and the dispenser.
Picaxe 1 displays on line 1 the temp data from the 3temp sensors on picaxe 2
Picaxe 1 displays on line 2 “Please select lalala…”
While the picaxe1 is waiting for the user to select the drink, data from the temp sensors are displayed/updated every say 1-2 seconds.  This is the part I’m not sure about.
User selects a drink from the controller via a simple physical switch.
Picaxe1 sends a signal to the transmitter and is received by picaxe2 which turns the relay on.
When user’s glass or jug is full, they turn the switch off which sends signal to turn off etc etc.
LCD displays “Thanks…..”
Program then resets.

Dam so simple in English!

I suppose I have some idea. I will have to create a long program that loops basically checks the inputs and then if they aren’t “high” then just do a temp read which then outputs to the LCD yes?

Sorry to be a pain.

Michael
 
Top