How can I create a switch pattern without using microcontrollers?

  • Thread starter Home Tinkers
  • Start date
  • Tags
    Switch
In summary, you need to hook up eight electromagnets and make them turn on and off to a pre designed pattern. You need to find a way to do this that is simple and flexible.
  • #1
Home Tinkers
3
0
I need to hook up 8 electromagnets and make them turn on and off to a pre designed pattern. I have no idea how to get something to turn on and off in a programmed sequence. I'm sure there are probably ready made programmable switches that come with software but I don't know.

In any case I need the quickest, simplest way to get 8 things to turn on and off in a pattern of my choosing.

Please let me know what to research, what specific things to learn, or items to look at for purchase to complete my project thank you.
 
Last edited:
Engineering news on Phys.org
  • #2
You need to specify whether this is a one shot sequence or whether there are time intervals as well as repetitions to be set . That will determine how simple your setup can be.
 
  • #3
I would want to be able to do it at time intervals of my choosing to loop until power is disconnected. I want to be able to change the pattern of each electromagnet firing to a new pattern for testing purposes, but the final product can be hardwired to one looping pattern that fires until power is disconnected and does not change.
 
  • #4
most flexible is a micro controller like arduino or pic, but you would have to learn programming.

look up "pic led sequencer", or "arduino led sequencer" to get started down that path. "LED chaser" gets hits too.

With a microcontroller the sky is the limit for flexibility.
 
  • #5
yea I saw a YouTube vid on microcontrollers how to solder leads into a breadboard and all that...seems time consuming to say the least even if you know what your doing. Then there is the software aspect of it at least I know c++ and a little java that should help. If that's what it takes there are good tutorials for it I guess. I really don't want to invest the time and money into it if there is a work around. I'm thinking if it comes down to using a microcontroller Ill just redesign my project and learn microcontrollers as a hobby on the side of my hobby I'm working on now because they seem pretty nice for lots of applications so I would want to mildly master them. I just really need to get this project near completion in about 1 month so I don't want to take on something like microcontrollers right now.

is there another way though? Maybe some kind of simple switch box that just records your on off commands and plays them back. Something like a computer key macro program for circuits? I would think some company somewhere would of made a unit that can output a range of voltages to different sources and also be programmed to regulate power and go on/off with some companion software. I imagine a box with 12 power-ports that have a specific voltage range and you can hook up any device you want to those ports (using homemade wiring), and using companion software you can program patterns for power flow through ports and power amounts within the range the device would support. If not there is probably money in that for anyone who could make such a thing. So I guess a cross between a power strip and a microcontroller is what I really could use.
 

Related to How can I create a switch pattern without using microcontrollers?

1. What is a switch pattern?

The switch pattern is a programming technique used to execute different code blocks based on the value of a variable or expression. It is often used as an alternative to an if-else statement.

2. How do I write a switch pattern?

To write a switch pattern, you will need to use the switch keyword followed by parentheses containing the variable or expression you want to evaluate. Then, you will use case statements to define different code blocks for different possible values of the variable or expression. Finally, you will use the break keyword to end each case statement.

3. What is the syntax for a switch pattern?

The general syntax for a switch pattern is as follows:

switch(variable or expression) {
  case value1:
    // code block to be executed if value1 matches
    break;
  case value2:
    // code block to be executed if value2 matches
    break;
  default:
    // code block to be executed if none of the values match
}

4. What is the difference between a switch pattern and an if-else statement?

The main difference between a switch pattern and an if-else statement is the way they evaluate conditions. A switch pattern evaluates a single variable or expression against multiple values, while an if-else statement evaluates multiple conditions. Additionally, a switch pattern can only handle equality comparisons, while an if-else statement can handle a wider range of conditions.

5. When should I use a switch pattern?

A switch pattern is useful when you have a variable or expression that can have multiple distinct values and you want to execute different code blocks based on these values. It can also be a more efficient and readable option compared to using multiple if-else statements for the same purpose.

Similar threads

  • Electrical Engineering
2
Replies
49
Views
2K
  • Electrical Engineering
Replies
4
Views
784
Replies
37
Views
3K
Replies
31
Views
2K
  • Electrical Engineering
Replies
14
Views
2K
Replies
2
Views
1K
  • Electrical Engineering
Replies
10
Views
2K
Replies
10
Views
2K
Replies
6
Views
1K
Replies
7
Views
1K
Back
Top