
mgodsell1973

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
Basically, if you get a multimeter set to DC volts.
Place the red lead on one side of the switch.
Place the black lead on the other side of the switch.
The voltage should (hopefully) read 0v.
Press the switch.
Check what the voltage now reads.
If it's a positive voltage then you need to somehow bypass the switch and apply that voltage to where the red lead is connected (or a point along it's trace).
If it's a negative voltage the same applies but to where the black lead is connected.
There are a few solutions. One could be simply using the signal of a digital port (however we would need to check a few things). Another would be to use a TIP122 and relay to short the switch. Once we have the the above info we can see how to proceed with it
If it doesn't make sense or you need further help just shout and I'll try to make a short video or sketches or something.
I have ran the multimeter across the switch, which gave me a reading of around 3v, then when I pressed the switch the voltage dropped to varying levels (different each time) for each press (during the depression), returning to about 3v whilst the light was doing each set.
I hope I have done this correct and it is the information you need to help me.
I cannot thank you enough for your assistance with this as my ideas out way my skill, but I am learning.
Martin
I'm sure it's still possible to use the EZ-B to simulate a switch push, it will involve me thinking a bit more about it though and right now my brain is fried.
Basically, the easiest way would be to do as Dave said and use a relay over the existing switch (or in place of it).
Use the TIP122 circuit to power a relay (I believe the relay would require the use of the diode mentioned in the circuit).
The relay would be opened/closed by the TIP circuit which would then switch the switch on the light board.
Quick scripts such as;
Code:
these would simulate a button push. Change D0 for the port as required.
A quick and dirty schematic...
So it's the simple TIP circuit as explained in my tutorial but rather than feed a lamp it feeds a relay. When the signal is high on the base of the transistor the relay is energised and closes. The other side of the relay connects (or replaces) the push button on the lighting board, when the relay is energised the switch is closed (i.e. button is pushed).
The short script simulates a push of 100ms, you may need to adjust the sleep to suit depending on the board itself. This will be trial and error.
From what you posted I believe it's a normally closed switch (NC)
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
Code:
Sorry, I don't do Arduino.....
Arduino code:
Code:
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:
Code:
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.
try this:
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.
i can;t stop smiling on my small yet significant step. i have learnt so much over the past couple of weeks.
thanks once again.
regards
Martin