navitron
 
Renewable Energy and Sustainability Forum
UK's most popular Renewable Energy Forum May 23, 2012, 09:35:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address - following recent spam/hack attempts on the forum, all security is set to "high", and "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: UPDATE ON DECC APPLICATION FOR LEAVE TO APPEAL TO THE SUPREME COURT | Yingli Green Energy's PV Module Ranks No.2 in TUV Rheinland Energy Yield Test | Navitron Solar Showers at Glastonbury for Year 5!
   Home   Help Search Login Register  
Pages: [1] 2 3   Go Down
  Print  
Author Topic: The other half - output devices  (Read 3085 times)
Baz
Hero Member
*****
Offline Offline

Posts: 1386


« on: October 03, 2010, 08:31:40 PM »

This thread is for output devices to compliment the input devices in the Halfbee thread.
http://www.navitron.org.uk/forum/index.php/topic,11337.0.html
which in turn gained its name from the development of 1wire input devices in this thread (which is in solar thermal / logs)
http://www.navitron.org.uk/forum/index.php/topic,8978.0.html
Logged
Baz
Hero Member
*****
Offline Offline

Posts: 1386


« Reply #1 on: October 03, 2010, 09:07:48 PM »

Relays.
Having once hand wired a board with 8 relays which was slow and looks 'orrible I have looked around for a pcb. There are many out there but the best value is the Velleman K8056 with 8 off 5A 240v relays. A reputable mfr with long track record and probable future. Note it is a kit - soldering iron required. Best value from
http://www.rapidonline.com/Educational-Products/Electronics/Velleman-Kits/8-channel-Relay-card/78035

It provides parallel input and also serial but to an awkward protocol with a leading <CR> and trailing 2scompliment checksum. An Arduino can handle this but it's an inconvenience. The onboard micro is a 14 pin PIC so could be replaced to use another protocol. (for easier programming a Picaxe-18X might do, next year perhaps the new 14M).

Velleman also do a plainer parrallel input board for 8 or 16 relays with psu
http://www.esr.co.uk/velleman/products/index_kit.htm
but it doesn't seem to be much advantage.
Logged
Baz
Hero Member
*****
Offline Offline

Posts: 1386


« Reply #2 on: October 03, 2010, 09:26:17 PM »

Relays Two
I recently found this 8 relay board. A direct link will fade in time so the link is to the ebay shop of rkeducation where you need to find part no "RKP18Relay8 8x Kam Ling SPDT Relay PCB with PICAXE-18X*" Note there are also 18M and 18 parts which are cheaper but have reduced processing.

The catch is the relays are only 110v 3A but perhaps a better replacement can be found. Still many things can still use them, like audio switching, ELV dump loads on small windturbine, CH zone control by putting a tiny heater on the TRV.

The on board Picaxe has 5 spare inputs, 3 being analogue, and all able to read a 1wire temperature with the simple line "readtemp pin".
More info when mine arrives.
Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #3 on: October 03, 2010, 09:48:19 PM »

Baz,
Maxim do a 8 bit output 1 wire slave (DS2408) and Hobbyboards use it in an 8 relay board. (@ $60)
If there is any interest, I will try and do a output only clone, to fit the Velleman board so it can be driven by 'off the shelf' 1 wire software but be the protocol used to control the DS2408 is rather complicated, so will be challenge.

A PicAxe is not suitable as a full spec one wire slave.
However if you build your own master to drive it, you could use both a simpler protocol and relaxed timings on the bus.

Eric
Logged
Baz
Hero Member
*****
Offline Offline

Posts: 1386


« Reply #4 on: October 03, 2010, 10:19:50 PM »

Eric,
Nice offer but I think it most likely that anyone wanting 8 relays would put them on rs232 off eg an Arduino which would also run 1Wire for temp and halfbees.
Something small like a dual output or one in one out Halfbee would compliment the input Halfbees well, for stringing out along a 1wire.

The Picaxe is rather limitted yet in simplicity lies a certain power so it deserves a thread of its own.
Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #5 on: October 04, 2010, 09:24:27 AM »

Baz,
I had assumed if you were doing your own master with say an Arduino you would have a large number of I/O available and would be able to drive a relay board with parallel outputs - there are a whole host of boards on Ebay such as  #160434622924.

I agree that if that's not the case then there is a requirement for a simple serial linked board. Adding a daughter input board to one of those parallel boards with just a PIC/PicAxe on it, would be a very simple and cost effective hardware and software solution

In terms of an output Halfbee, I have done the basic coding for one that looks roughly like a DS2405 but because an open drain output is not available, an external FET is required for a reasonable voltage rating. A dual DS2406 (without memory) is probaly do-able but to get a selectable range of ROMID's a bigger pin count PIC than were are currently using would be needed.


Logged
wyleu
Guest
« Reply #6 on: October 04, 2010, 09:32:22 AM »

Could people dump suggestions for the sorts of devices they'd like to control?
Logged
Baz
Hero Member
*****
Offline Offline

Posts: 1386


« Reply #7 on: October 04, 2010, 11:28:38 AM »

Nice find Eric, 10A 240v.
Linking to their shop as they do 4 and 2 relay boards and other stuff if you don't mind ordering from Hong Kong.
http://stores.ebay.co.uk/AudioWind

I was controlling some lights from a PC elsewhere hence RS232 preferred to parallel but tempted to add local processing.
Other targets:
Dump load switching.
CH zone valve and radiator control.
WBS air vent would be challenge as they aren't designed for it.
Water pumps - various.
Garden irrigation.
Logged
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #8 on: October 07, 2010, 05:43:20 PM »

Hi
Just noticed this thread and it could be just what im after which is Help !

I have written my own full house temp monitoring and heating controller run from a PC which is permanently on.
I have used a One wire system with DS18s20's and so far it's working well.
So I want to add a DS2408 chip which i have temporarily wired to a breadboard at the moment. I have ordered some relay driver ICs and some solid state relays from hong kong.

I have wired the DS2408 with led's on the I/O pins so that i can test my software - which I am happy to say controls the outputs fine.

My problem is that i have left it all connected with 255 written to the latch so that the led's are all off. but when i look in the morning the latch seems to have set itself to zero and all the leds are on.
Not being an expert (by a very long way!) with electronics I don't really understand what is happening?

I know that the ports are open collector - should i use a 10k pullup resistor on each port to stop them drifting back to zero? (if thats what is happening) ??

any help would be appreciated. Once i get the relays working i will be running my whole central heating via these ports (hopefully lol) flyingpig

Mike


Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #9 on: October 07, 2010, 09:14:07 PM »

Mike
Do you power the chip explicity or use parasitic power. If you don't then powering the chip may help.
Otherwise it looks very odd. As in requires a data - data inverted sequence to write to the registers is would seem unlikely that this is being triggered by noise. Removing the 1 wire signal would make sure that it wasn't accidently coming from the master.

So that leaves the reset line which should be tied high (but if it wasn't then channel access write shouldn't work) also my reading of the data sheet says that the reset state is the output devices off ie outputs high.

It could be doing a power on reset but as then the state is supposed to be undefined so there is only a 1 in 256 chance it would be all low.
The LED would pull up the outputs but whatever you do on the outputs, within reason, shouldn't affect their states.

Eric
Logged
StBarnabas
Hero Member
*****
Offline Offline

Posts: 2111


St Barnabas Chapel (2009)


« Reply #10 on: October 07, 2010, 10:00:21 PM »

Very interesting thread. Ditto to Eric and Wyleu - if there is a need to do things then it will move it up he agenda. I and I suspect many of us have a host of projects I would like to complete but am limited by time.
Sean
Logged


Gestis Censere. 40x47mm DHW with TDC3. 3kW ASHP, 9kW GSHP, 3kW Navitron PV with Platinum 3100S GTI, 6.5kW WBS, 5 chickens. FMY 2009.
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #11 on: October 08, 2010, 10:20:32 AM »

Mike
Do you power the chip explicity or use parasitic power. If you don't then powering the chip may help.
Otherwise it looks very odd. As in requires a data - data inverted sequence to write to the registers is would seem unlikely that this is being triggered by noise. Removing the 1 wire signal would make sure that it wasn't accidently coming from the master.

So that leaves the reset line which should be tied high (but if it wasn't then channel access write shouldn't work) also my reading of the data sheet says that the reset state is the output devices off ie outputs high.

It could be doing a power on reset but as then the state is supposed to be undefined so there is only a 1 in 256 chance it would be all low.
The LED would pull up the outputs but whatever you do on the outputs, within reason, shouldn't affect their states.



Eric
Thanks Eric
I am powering it parasitically but I can use the power for the new board easily. I was trying to keep the driver side of the chip as seperate from the chip as possible IYSWIM

I experemented last night -I put a 10k resistor on to the vcc line on the One wire cable onto P/O port Zero and strangely this morning that is the only one that has turned on!
Which is the opposite of what I thought would happen.

You say the reset pin should be tied to vcc? I couldn't find that info anywhere. so I left it floating. So maybe that will do the trick.
should i use a resistor on that pin to vcc?

I will try the reset pin first, then the power supply, then if none of that works i will try taking the data line off experimentally.

As it seems to happen only overnight it might take 3 days to prove it !   wackoold

thanks again

Mike

PS
do you know what these other registers do in the DS2408
PIOActivityLatchState  -read/write   
RSTZconfiguration        -read/write   
PIOlogicstate              - read only
« Last Edit: October 08, 2010, 10:56:06 AM by mpooley » Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #12 on: October 08, 2010, 12:26:39 PM »

Mike,
The Maxim data sheet is here http://datasheets.maxim-ic.com/en/ds/DS2408.pdf.

To save you wading through it, the bit about the RSTZ line is in the note on page 16. You should be able to tie it directly to Vcc but a resistor won't do any harm.

Extracts from the data sheet

PIO Activity Latch State Register
 "The data in this register represents the current state of the PIO activity latches. This register is read using the Read PIO Registers command. "
Activity latches are set when the state of an I/O pin changes.

RSTZ configuration
 Best read from page 11 of the data sheet - default is a reset rather than a strobe so can be left.

PIO Logic-State Register
The logic state of the PIO pins can be obtained by reading this register using the Read PIO Registers command.

If the problem persists you could monitor the first three registers (flow chart on page 12) to see what is happening.

Eric
Logged
mpooley
Sr. Member
****
Offline Offline

Posts: 347


« Reply #13 on: October 08, 2010, 01:47:27 PM »

Mike,
The Maxim data sheet is here http://datasheets.maxim-ic.com/en/ds/DS2408.pdf.

To save you wading through it, the bit about the RSTZ line is in the note on page 16. You should be able to tie it directly to Vcc but a resistor won't do any harm.

Extracts from the data sheet

PIO Activity Latch State Register
 "The data in this register represents the current state of the PIO activity latches. This register is read using the Read PIO Registers command. "
Activity latches are set when the state of an I/O pin changes.

RSTZ configuration
 Best read from page 11 of the data sheet - default is a reset rather than a strobe so can be left.

PIO Logic-State Register
The logic state of the PIO pins can be obtained by reading this register using the Read PIO Registers command.

If the problem persists you could monitor the first three registers (flow chart on page 12) to see what is happening.

Eric

Thanks Smiley

am i being thick here but i read the output latch directly the others seem to just be a copy of the output latch?

Just had another look and all the pins have switched on again!
the PIOoutputlatch is zero
the PIOLogicstate is zero
but the PIOActivityLatchState  is   255?

I have pulled the RSTZ high  now and all leds went out but i am still reading zero in the PIOoutputlatch?
removed the high to RSTZ and all the leds come back on again.
I am very confused

BTW I am using a high level language to read these registers as I use the EDS OWserver and I just read and write to a webpage interface

thankyou for your help

Mike
Logged
ericw
Hero Member
*****
Offline Offline

Posts: 735


« Reply #14 on: October 09, 2010, 08:45:14 AM »

Mike,
The output state latch should be the state of the actual i/O pins. The logic state register is the data that should set the state of the pins.
If you have loads connected to +5 then they should read the same. If you had something holding the an output pin low externally then you could get a 0 in the output state latch and a 1 in the logic register. Also if you did not have a pullup (load) on a pin the output could reported in either state.

Definitely something doesn't seem right if the outputs are not staying high after a reset and the output latch is going to 00. Are you sure that the software is not somehow writing data ?

I think you need to do something similar to this sequence to see if all is well.

RSTZ needs to be tied high, if you use a pull up resistor then you can take it low by just shorting it to ground.
Bit b2 in the control register should also be 0 (should default to this on power up)

Taking the RSTZ pin low briefly should reset the output register to FF (all off) and the the output state latch should follow assuming you have loads connected.
If you then write data to the chip, the registers should follow this data.
I wouldn,t worry about the activity latches but it should be set to 00 on powerup or reset and if the state of an output changes it's bit will go to one (and stay there until the latches are reset)

Eric

Logged
Pages: [1] 2 3   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!