United Kingdom
Asked — Edited
Resolved Resolved by Rich!

Bypassing A Mini Push Button Switch

Hi there, I am looking at adding a cool lighting system to my new robot "Trakx" (creative I know), the lighting is similar to the under car systems neon systems you can buy. My version uses a torn down led wire that you can attach to a bike. I have removed it from its casing and using simple wiring have managed to bypass the switch, but the question is will the v4 allow me to use the 3 different modes and how to wire it up?

I was thinking about using the modes as a visual warning system (ie the closer Trakx gets to something/one the faster it flashes)

Thanks for looking

Any advice welcome


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

United Kingdom
#17  

Slight amendment, check the continuity of the push switch on the lighting board before connecting to it. If it is shorted (0 ohms) when not pressed use the NC pins of the relay not the NO pins. If it's open (infinity/>299/>999 or similar reading) when not pressed use the NO pins as my schematic.

From what you posted I believe it's a normally closed switch (NC)

United Kingdom
#18  

Once again thanks @Rich, I will post when working.

United Kingdom
#19  

hello again, i have built the curcuit (thanks @Rich). but........ theres always a but. i want to test that it works and tried to write code for my Arduino to send a pulse to when and object comes within a certain range to run the first mode, then again if the distance to the object decreases and again if distance closes even more. (like a visual waring system).

but resets once out of the set "a

unfortunatly the fine folk on the arduino forum don't appear as helpful with my plight.

does anyone know how to code "Adruino" or are able to provide me with code for EZ-B V4 that i can use to do this?

i can provide my atempt at "Arduino" code if needed.

thanks once again for being so supportive

regards

Martin

#20  

If you are using Rich's circuit and code above... In ARC to turn that circuit on and off is very easy...



set(D0,ON) #Turn on circuit
sleep(100)

set(D0,OFF) #Turn off the circuit

Sorry, I don't do Arduino..... :D But you need a way to make the arduino's port go "HIGH" then low briefly to simulate a button push....

United Kingdom
#21  

I'm not that great with Arduino code but from my limited knowledge it would just need to turn a pin to high to enable the relay, then drop back to low which should simulate a button push.

Arduino code:


  digitalWrite(13, HIGH);   // set the pin to high
  delay(1000);               // wait for a second
  digitalWrite(13, LOW);    // set the pin to low

It's very much like the blinking LED tutorial but without the loop and without the second delay (in fact that's what I copied for the above pretty much).

EZ-Script code:


Set(D13, On)
Sleep(1000)
Set(D13, Off)

If required change the sleep/delay from 1000 (1 second) to a lower value if a 1 second button push is too long.

I believe the Arduino has an LED on pin 13 too which should also be illuminated when the relay is switched, which should verify the code is working.

If it's not obvious the above code/script are only snippets which need to be part of a bigger code/script.

#22  

@Rich, sorry, I did not see the question until now. 555 and 556 circuits are everywhere.

:D

try this:

United Kingdom
#23  

Mel, I'm not sure how you are imagining a 555 timer would achieve what the OP wants to achieve in this. It's basic simulation of a button press of an existing circuit not control and sequencing of lighting patterns.

United Kingdom
#24  

thanks guys, i think i may have been over thinking the coding on arduino.

as i had used a "switch case" to tell when an object was "X" distance from the sensor and the closer my robots gets to the object the more "reps" of code it runs, but just to test the curcuit your code will be ideal.

looking forward to working with ARC/EZ script, just waiting for the holy grail "item shipped" email.

:D