Can I use a M0 for this?

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
magoogle
 
Posts: 1
Joined: Mon Jul 18, 2022 3:57 pm

Can I use a M0 for this?

Post by magoogle »

I want to take a switch that provides resistance values depending on position and have it perform an action based on those values.

The switches values are as such: Down is 47Ω to ground, Up is 307Ω to ground. No switch pressed is 10kΩ to ground.

The action would be to control a forward/reverse relay module that is 3 wires. FWD/GND/REV. Model: F-1020 12v, Specs: Operating Voltage 10 - 15v DC, Switch Short current 30mA @ 12V

Will the M0 handle this? If not, is there another tiny controller that could?

User avatar
dastels
 
Posts: 15659
Joined: Tue Oct 20, 2015 3:22 pm

Re: Can I use a M0 for this?

Post by dastels »

Any microcontroller will be able to do this with the right additional circuitry. You would add a pullup resistor to Vcc to turn those switch resistances into a variable voltage divider, then read the voltage at the point between the pullup and the switch using an analog input. The relay would need a drive for each of FWD and REV. A transistor and shunt diode for each will probably suffice. See https://learn.adafruit.com/transistors- ... rs-2998941.

Dave

User avatar
XRAD
 
Posts: 754
Joined: Sat Nov 19, 2016 3:28 pm

Re: Can I use a M0 for this?

Post by XRAD »

Yes, you can read the resistance in your code and 'do' something with it....That's how you can get multiple functions off one pin, like stereo control steering wheel buttons in a car...just have to read the pin for state changes....

classic example: rotary resistance switch with 'x number of' positions....

another way is by 'timing' the button press...ex: 1 second is forward, 2 sec is reverse...ect....

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”