Grünstern - MOV-E shortboard, 12s3p NESE, Hummie Hubs, Hammock baseplates

Let there be light:

Now I’ll try to get the ppm values and let it react on braking, the more brake the more light :slight_smile: first I tried to use vesc uart communications but it seems that there are no values I could use :frowning:

3 Likes

Sounds good!

:smiley: Actually I think I’ll change plans once more. I got a Gyroscope breakout when I started all this eSkateboarding stuff to implement something like Mellows endless ride. Now I’ll try this to detect braking independently from all other board electronics (apart from power) to avoid interference :wink: For the front lights I got two strong waterproof LED flashlights I’ll mount left and right from the front baseplate :slight_smile:

1 Like

Well I have seen cheap light on Ali with a giroscope or something inside to detect braking. You could use the circuit for your light.

1 Like

I just found what you mean, might be an option if I fail miserably :smiley: But the self-made variant could also be modified to detect when it makes no sense to have lights on (eg. carrying). Someone on this or the other forum had a similar idea :thinking:

1 Like

Yep the auto turn off function would be nice.

1 Like

I found out that the @Pimousse version of the VescUART library indeed has support for the actual PPM values, so now I’m going back to communicating with the FSESC :slight_smile:

4 Likes
7 Likes

Woowww… As usual that was quick. Great success… Now please make the instructable :grin:

1 Like

Sure :slight_smile:

  • Arduino Nano clone
  • WS8212B led strip
  • cabling
    Connect the led strip as follows:
    Arduino 5v -> 5v in
    Arduino GND -> GND in
    Arduino D6 -> Din
    Arduino Vin -> VESC 5V
    Arduino GND -> VESC GND
    Arduino TX -> VESC RX
    Arduino RX -> VESC TX
    Since I just used a strip with 6 leds it should be ok with the power supply from the VESC over the arduino, otherwise you might need a step down converter or similar.
#include <buffer.h>
#include <datatypes.h>
#include <VescUart.h>
#include <crc.h>

#include <Adafruit_NeoPixel.h>

#define PIN        6 // Which pin on the Arduino is connected to the NeoPixels?
#define NUMPIXELS 6 // // How many NeoPixels are attached to the Arduino?

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
VescUart UART;
void setNormalLight();
void setBrakeLight(int);
void setup() {
  pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  Serial.begin(115200);
  while (!Serial) {
    ;
  }
  UART.setSerialPort(&Serial);
  setNormalLight();
}

void loop() {
  float PPM_in;
  if (UART.getLocalVescPPM()) {
    if (UART.data.throttlePPM < 0) {
      setBrakeLight(255);
    }
    else setNormalLight();
  }
  delay(100);
}

void setNormalLight() {
  pixels.clear();
  pixels.setPixelColor(2, pixels.Color(20, 0, 0));
  pixels.show();
  pixels.setPixelColor(3, pixels.Color(20, 0, 0));
  pixels.show();
  pixels.setPixelColor(1, pixels.Color(20, 0, 0));
  pixels.show();
  pixels.setPixelColor(4, pixels.Color(20, 0, 0));
  pixels.show();
}
void setBrakeLight(int intensity) {
  pixels.clear();
  for (int i = 0; i < NUMPIXELS; i++) {
    pixels.setPixelColor(i, pixels.Color(intensity, 0, 0));
    pixels.show();
  }
}

Depending on where your PPM signal is in a dual setup you need to use the function UART.getMasterVescPPM(Can_ID).

Thanks @Pimousse for your fork with the PPM values, I was almost sure after research that its not possible to get the value from a VESC. https://github.com/Peemouse/VescUart

11 Likes

You can go at least the double of LEDS with the VESC power supply (as you’re using only the red color)
12x20mA = 240mA. Still room left.

SmartRings (with 12 RGB leds used for gauge + 8 for rear light) can be powered by the VESC also without any trouble.

1 Like

Seems feasible also for me. Nice! Thanks

image
New front bumper design with headlights :), printing at the moment. I disassembled a LED flashlight just for the LED and the reflector, lets see how it turns out :slight_smile: The flashlight is very bright but thats just my feeling :smiley:

btw, I thought of a nice method of switching the lights on and off: pressing brakes while standing for 5 times in a given timeframe :wink:

1 Like

Its printed as usual: 20% infill, 4 wall/roof/bottom layers 95A Sainsmart TPU (which is incredibly printable btw). The infill value result in an airfilled cushion, not comparable to the standard bumper stuff. The board bounces back from walls :wink:

1 Like

Would these work for this kind of project?

Basically yes, but look for versions without soldered headers and solder the cables directly to the pcb.

1 Like

Would you know how to program an arduino to make a knightrider style light?

My new bumper, not sure if its still bumping but its making light instead :smiley:

Before:

After:

I’ll run this LED with a up to 56V LED Driver with 1A, the arduino will control Amps via PWM. I figured that brightness is similar if not the same as before when it was a flashlight, temp goes up to 45deg celsius which is still ok, but lets see how powerful I need it to be :slight_smile:

6 Likes

Just google “Arduino Neopixel KITT” or “Knight Rider”, there are lots of examples :wink:

2 Likes

@Flasher Actually an Arduino Micro would be better, the Nanos have only one UART, which makes the debugging of VESC communication horrible since that connection uses the one UART and you can’t simply open a Serial console. Because I’m sick at home and left my Leonardo at work I had to use a 128x64px OLED display to display debug values :smiley: