Can I connect a push and pull solenoid to a thunderborg? Many Thanks
piborg
Fri, 02/21/2020 - 09:57
Permalink
Yes, ThunderBorg can control a push and pull solenoid.
Connect the solenoid up like a standard motor, then work out the correct drive power as follows:
drivePower
=
solenoidVoltage
/
batteryVoltage
For example a 5V solenoid with a 9V battery would be:
5.0
9.0
You can then drive the solenoid as follows:
# Move one way, then turn the power off
TB.SetMotor1(
+
drivePower)
time.sleep(
1
)
0
# Move the other way, then turn the power off
-
If it is connected to M2 instead of M1 use SetMotor2 instead.
SetMotor2
piborg
Fri, 02/21/2020 - 09:57
Permalink
ThunderBorg and solenoids
Yes, ThunderBorg can control a push and pull solenoid.
Connect the solenoid up like a standard motor, then work out the correct drive power as follows:
drivePower
=
solenoidVoltage
/
batteryVoltage
For example a 5V solenoid with a 9V battery would be:
drivePower
=
5.0
/
9.0
You can then drive the solenoid as follows:
# Move one way, then turn the power off
TB.SetMotor1(
+
drivePower)
time.sleep(
1
)
TB.SetMotor1(
0
)
# Move the other way, then turn the power off
TB.SetMotor1(
-
drivePower)
time.sleep(
1
)
TB.SetMotor1(
0
)
If it is connected to M2 instead of M1 use
SetMotor2
instead.