What hardware do I use? what coding language do I learn?

Thread Starter

Ariel Kartashev

Joined Nov 23, 2018
1
I need help designing a circuit to control a servo motor, the model i have is an SG 90 (9g) It needs to be controlled by a sensor that receives and input from a moving object, (the object moves down), and the sensor reads the signal 1 -> 2 the servo moves up 120deg, (the object moves up) and the sensor reads the signal 2->1 the servo moves down 120 degrees. I do not know what sensor I could use to provide this signal, i am guessing the signal 1 could be a positive pole of a magnet and signal 2 the negative pole, what sensors could i use? what cpu do i need? how can i adjust the amount the servo moves if need be? what language is best to learn to code this?
 

ericgibbs

Joined Jan 29, 2010
18,734
hi Ariel,
Welcome to AAC,
Look up Hall Effect sensors for the magnet poles.
For MCU, the Arduino is easy to program and well supported on the web.
E
 

Attachments

MaxHeadRoom

Joined Jul 18, 2013
28,576
For a sensor there is the Honeywell SS400 range.

The SS400 Series and SS500 Series are small and versatile
digital Hall-effect devices that are operated by the magnetic
field from a permanent magnet or an electromagnet, and
are designed to respond to alternating North and South
poles, or to a South pole only. They are available in bipolar,
latching or unipolar magnetics. On-board regulation provides
stable operation over a 3.8 Vdc to 30 Vdc supply voltage
range.

Max.
 

sc0tch

Joined Nov 6, 2018
64
Sensors your best option is going to be a hall effect sensor. For devboard id recommend either an Arduino for non internet connected tasks and a raspberry pi 0w for Internet of Things tasks as you can't beat the $10 pricetag for a wifi connected dev board.

Keep in mind a couple of things however, raspberry pi does have the negative of having the overhead of a Linux operating system, while an arduino simply executes code straight from it's programmable flash memory. With that said a raspberry pi also can use it's os as a benefit as you can code in several different languages with GPIO libraries highly supported for both C and Python, you can also edit code either by VNC remotely or by plugging it into a keyboard, mouse and monitor without a computer.

With that said in my experience it is often easier to make an electrical mistake that costs you your dev board with the Raspberry Pi. Not sure if it just has tighter tollerances for current draw and voltage, or if the Arduinos have better over current protection. I know i have thrown at least 3 rPis in the trash and yet to throw away either my arduino uno or nano.
 

danadak

Joined Mar 10, 2018
4,057
What is the precision of motion/detection you are dealing with ?

The servo easily controlled with PWM.

Is the sense a fixed position trip or is it amount of motion, and as you say direction, that matters ?

If fixed position to do the reversal a photo interrupter would be easy sensor. Or as previous
posted Hall Effect or if degree of motion accelerometer.

A PSOC contains the analog and digital to solve this interface. If sensors digital
interface other processors equally capable.

Language would be C to program. Under certain circumstances PSOC can do everything
with no code, depends on details of what you are doing en total.


Regards, Dana.
 
Top