Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

little help needed?

Status
Not open for further replies.

Jbroadway

New Member
hi im looking at a schematics for a automatic coop door opener and i think it looks ok but the problem i see is that it uses an msp430 launchpad and id like to use a pic as im familiar with this.

schematics here

my question is, can i just swap the launchpad with a pic board and still do the same thing or will i have to alter the schematics?
 
There's no reason why you can't do this with a PIC, provided it has enough I/O and includes an A-to-D function. It will obviously be important to get the supply voltages right.
I'm a little puzzled as to why the switching around S1 and S2 needs to be so elaborate and why it needs a latching relay (I think) to switch the solar panel, and I wonder is it ok to switch the panel directly across the battery?
 
well i have a picaxe 18x2 coming and i was thinking of using that. i have a 6v rechargeable battery and i was going to use a 6v solar panel

to regulate the power for the picaxe i could just use two diodes to reduce the voltage from 6v to 4.8v which is what the picaxe needs to work.

another question would be about wiring this to the picaxe would it be the same output pins and what do the pins want to be saying in the code?

i suppose what im actually asking is why is the picaxe or microcontroller needed? is it to so that the picaxe reads the light level using readadc from the solarpanel and tells it when to close?

sorry one more question on the schematics where the solar panel is there is a spdt switch but o1 is not connected and s1 is connected to ground so the solar panel doesnt go back to the picaxe am i correct?
 
My reading of the schematic is that the Launchpad pin functions are as follows:-

1 +3V supply to micro,
2 analogue input, monitoring photocell,
3 analogue input, monitoring battery voltage,
4 no connection,
5 digital input, monitoring coop door switches,
6 digital output driving Q1,
7 digital output driving Q2,
8 digital output driving Q3,
9 digital output driving Q4,
10 GND

Q1 and Q2 are both for motor control.
Q3 and Q4 respectively set and reset a two-coil latching relay which operates switch K1 to connect/disconnect the solar panel.
What actual logic the Launchpad applies to its various input and output signals is not altogether clear. Clearly you would have to replicate the overall function of that with the Picaxe, as well as replicate all the I/O connections.
The Launchpad checks the light level and if it is above some threshold opens the coop door. It closes the door when the light level drops below another threshold.
 
Last edited:
You will still need transistors Q1 to Q4 and the other components shown.
 
ive never made my own schematics up and i wouldnt know where to start but if i try and draw up a simple schematics would you be able to tell me what wrong or whats needed??

few little questions,

1. how do you get the values of the caps & resistors
2. does it matter what output/input they go into on the pic (aslong as they are i/o ports i can config them right???)
3. do i wire the solar panel into the pic also (for monitoring and switching on and off?)
4. how does the solar panel recharge the battery without being connected to it?
 
if i try and draw up a simple schematics would you be able to tell me what wrong or whats needed?
Probably.

Answers:
1) Component values would depend on the properties of the motor, solar cell and power supply. You would need to know those before choosing the values.
2) AFAIK, yes. I believe the PICaxe (I'm not familiar with it; does it even have analogue functions?) has some dedicated pins which aren't available as general purpose I/O.
3) Not directly. The PIC would drive Q3 and Q4 to switch the panel into circuit. The panel voltage is not monitored.
4) It can't; it requires a connection. See answer 3.
 
It had programmable I/Os and yes it does have analogue inputs so the solar panel connects to a transistor, how does it recharge the battery then? Would it be easier to just have the solar panel doing the charging and adding an ldr to the circuit for the light detection
 
so the solar panel connects to a transistor
It doesn't in the schematic. What do you want the transistor to do?
how does it recharge the battery then?
By connecting the panel directly across the battery. I'm not convinced that's a good idea (but it would depend on the battery and panel properties and on the decisions taken by the Launchpad).
Would it be easier to just have the solar panel doing the charging and adding an ldr to the circuit for the light detection
That's precisely what happens already. OPH1 is the LDR and pin 2 of the Launchpad checks the light level.

BTW, in a quick Google I found PICAXE-18X listed but not the 18X2. Other X2 parts seem to be 3V versions. Confirm which one you've got, as 4.8V from your battery would kill a 3V part. If yours is not a 3V part then the 3V voltage regulator and its associated caps can be omitted. With only a 6V battery you will need a low drop-out version of any 5V regulator used. Even that might be marginal, as the battery voltage will drop when the motor kicks in. That drop might cause the micro to re-set or throw a wobbly.
 
sorry my bad its the 18M2 that i have sorry.

now im even more confused so in the schematics they are not using the solar panel as a ldr and why isnt it connected in the schematics :S

and i dont know what i want the transistor to do because i didnt know why i needed it, sorry i have no history from the technical side i only pick up schematics and copy them onto boards so when it comes to making my own schematics, which is why i am so confused about this schematics.
 
Some of the PICAXE series has been designed to be a wide voltage part. What happens is that they operate nearly from 2V to 5.5V. A on-board low drop out regulator is enabled if required. The die is a 3V part. www.PICAXE.com

The MSP430 launchpad is really cheap. The MSP430 may consume less power in sleep.

The latching relay was used because this is a low power design.
 
"Outputs:
Each output can sink or source 20mA"

this is from picaxe data sheet about motors

the motor i am buying will be this
Description:

Voltage Range: 4-6V DC
Idle Rotating Speed: 3.0 ±1 RPM
Ambient Temperature: 0 - 40 deg C
Rotation Direction: Positive pole to “+” contact; Negative pole to “-” contact
Idle Current: 0.025A (0.050A Max)
Low Voltage Start: 1.5V or less
Load Torque: 2.8kg. cm
Load Current: 0.050A (0.075A Max)
Load Rotation Speed: 2.1 ±1 RPM
Axial Play: 0.4mm or less
Motor Idle Current: 0.015A
Motor Idle Rotation: 1500±10% RPM
Shaft Length: Approx. 0.46 inch / 11.6 mm
Shaft Diameter: 0.12 inch / 3 mm
Gear Box Diameter: 1.6 inch / 40 mm
Motor Diameter: 1.26 inch / 32 mm


seeing as the total load is 0.05A which is 5mA i could drive the motor directly from the picaxe and then i can simply program it to move forward/backwards at certain times.
"backward Drive a motor backwards
forward Drive a motor forwards
halt Halt a motor"

from command list

the question i have is the limit switches, could i add these as a single input to read as it hits either one it halts the motor and thats it? or would i have to add thses as seperate inputs with the same command prompt?
 
total load is 0.05A which is 5mA
No, it's 50mA. But the MAX load current is 0.075A, = 75mA. That is too much for the PICAXE to provide directly, which is why you need Q1-Q4.
the question i have is the limit switches, could i add these as a single input to read as it hits either one it halts the motor and thats it?
That's what is already done. The Launchpad pin 5 monitors both limit switches.

It occurs to me you might want to add an extra switch fitted to the door edge, to stop the motor if a hen gets trapped by the door. Alternatively, monitoring the motor current would detect a stalled motor.

Edit: By my reckoning that motor won't be able to move the door faster than about 6 cm per minute; so ~ 5 mins to open/close the door. Is that ok?
 
Last edited:
how did you work that out? i thought it would be a bit quicker than that? so you reckon a 20 rpm one would be better? and i could add any number of switches in to limit it as safety features.

so i feed the transistor from the picaxe and then from the picaxe i feed the motor?

does that mean i will need to use two outputs one for the forward transistor and one for the reverse transistor both wired to the motor?
(instead of transistors can this be done with two relays instead)

thanks for the help btw
 
how did you work that out?
The quoted motor torque is 2.8Kg.cm. I assumed you would probably need ~ 2.8Kg to overcome friction and move the door. The motor can provide that force at a radius of 1cm from the output drive shaft axis. So let's assume the door is moved by a string wrapped round a pulley on the shaft. If the pulley has a 1cm radius its circumference is ~ 6cm. So at 2 rpm the string will only move ~12cm per minute. I don't know your door width, but if we guess 48cm then it will take ~ 48/12 = 4 mins to open (say 5 mins to allow some margin).
you reckon a 20 rpm one would be better?
That depends on the torque available. You don't want it too fast or you'll have sliced hens :)
 
i could add any number of switches in to limit it as safety features
Yes, providing you have spare inputs on the PICAXE, or providing only one at a time would be actuated so that a single input would be able to monitor them (as is already done).
so i feed the transistor from the picaxe
Which transistor? Check the use of Q1-Q4.
does that mean i will need to use two outputs one for the forward transistor and one for the reverse transistor both wired to the motor?
A common arrangement is an H-bridge of transistors/FETs, or you could use one transistor/FET for 'motor on' and another transistor for actuating a DPDT change-over relay for direction control.
instead of using the mosfets he has used can i use relays or transistors?
Why would you want to? Mosfets are more power-efficient. BTW mosfets are transistors. Presumably you were referring to bipolar transistors?

Have another look at that Chrisatronics link in your first post. The answers to some of your questions are already there!
 
Last edited:
ok so say i stick with mosfets, will that allow 6v to the motor but fed from an output on the picaxe?

motor drive.jpg

is this correct?

also i had a small thought, i was thinking something like this.

to move the motor forward make output 11 high 10 low
and then it hits my limit switch which halts the operation
lets say the limit switch is on input 9 is switched high it stops the motor

my question is if i then reverse this process to make the motor reverse will it not just keep cancelling itself out because input 9 is still high?
or can you program this to just be a single signal and not a recurring signal?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top