PICAXE and servos

itolond

New Member
Hi All,

looking for some guides:

I wish to control blinds using servos and picaxe (ps i have seen the blind controllers stuff) However my question relates to:

can i control multiple servos (e.g. i have multiple blinds that i wish to operate in sync) and......

what if the get out of sync (is there a centre command to reset all servos to a known point)?

Extras:
if I use a dimmer (unit to control) and also wish for auto operation (open when light/ close when dark) how would this be achieved in terms of the relative positioning of the 'manual' control (dimmer). I assume I would throw in a manual/off or auto switch

any guide how to approach
 

westaust55

Moderator
There is no "centre" command inbuilt but you can easily write a subroutine to set them to any desired position with the SERVOPOS command. Nominally a setting of 150 is the mid position but can vary and you may want a slightly different position to "dead centre".

By "dimmer" do you mean a potentiometer?
A potentiometer would a reasonable choice.
An LDR could be used as a light level sensor to auto adjust the blinds.

There are posts on the PICAXE forum where others have gone through this excercise (auto blind control).
You say you have read threads - but here or elsewhere.
Seems a bit more study of similar past projects could be helpful.
 

itolond

New Member
Hi all,

I have had a look at the previous posts, but was unsure how to manage multiple servos. yes potentiometer in terms of dressed control for domestic use.
''could l link two picaxe chips - an operate 16 servos?
 

westaust55

Moderator
Additionally, with the AXE031 you can have an 18 pin OPICAXE chip on board or an extreme all chip communicating. Is i2c comms.

If you are seeking to have multiple potentiometers plus say an LCD to detect light level you need to consider how many analog (ADC) inputs you need in total and how many each PICAXE chips has.

The AXE031 board does bring 11 I o pins to a header for external use. The Datasheet is orientated to the older 18X chip so when using a newer 18M2 chip refer to the diagrams in PICAXE manual 1 around pages 9 to 11 to match available 18M2 IO and which are analog compatible.
 
Last edited:

binary1248

Senior Member
If you want all the servos to operate in sync, then only one servo output pulse is needed to drive multiple servos. Now I am talking about RC servos. They are available with very high torque capabilities, but for position control with internal feedback, most will only turn 180 degrees.
.;
Code:
;Simple Camera shutter control
;Servo pin is pin 8 on 18X
;Led is pin 13
; M<aximum interval shutter trip time is 8 sec
; Min time is 1 sec
;Interval time is set by pot/adc
;
;
#picaxe	18x
symbol led=7 ;pin 13 on chip

Start:
	Servo	2,160  ;preset servo
	
	
	for b1 =1 to 5 ;chance to give about 3 sec befo shutter start
	high led
	pause 100
	low led          ;blinky light to show startup has occured
	pause 100
	next b1
	
	
	;	Servo max 75 to 225
	; The pulse is in 10 us intervals, thus servo max
		; max = 225, min 75  nice fit
	Main:
		high led
		servopos	2,160
		readadc10	0,w1	;read pin 17 (chan 0) as 10 bit A/D.
		;
		;use value from a/d for delay
		w1=w1*8
		if w1<1000 then
		   w1=1000
		endif
		
		pause w1    ;interval delay
		low led
		servopos	2,205   ;trip shutter
		pause 800
		
		goto main
 

itolond

New Member
This is what is wanted to know - wonderful thx. My wife would kill me if this didn't work, hence 20 questions (is the a code to remote control your spouse? JoKing)
 
Top