DAVEga: Battery monitor, odometer, speedometer

I had the white screen too. But i reinstalled the cp driver and reselected the com port and then it worked for me

1 Like

Here’s how to save the day if you assemble a DAVEga before burning a bootloader on the MCU first. Note that this should never happen to you if you have a kit from me since all MCUs come with a bootloader.

I tried to do it today on a board that doesn’t work. I thought that maybe the MCU doesn’t have the bootloader since there wasn’t any other apparent reason. It didn’t work so the MCU is probably dead. I tried doing the same on a good board first to test that I’m doing it correctly and that did work.

So here’s how to. Fortunately, the display headers connect to the right pins and we can leverage that.

  1. Take an Arduino and upload the “Arduino ISP” to it (File > Examples > Arduino ISP > Arduino ISP). For Arduino UNO this should work out of the box. I used Arduino Pro Micro, for which I needed to slightly modify the code. I made it available here.

  2. Connect the Arduino to the display headers as follows:

  • 5V -> VCC
  • GND -> GND
  • on Arduino Pro Micro
    • pin 15 -> CLK
    • pin 14 -> RST
    • pin 16 -> SDA
  • on Arduino UNO
    • pin 11 -> SDA
    • pin 12 -> RST
    • pin 13 -> CLK
  1. Connect pin 10 (both UNO or Micro Pro) to the reset pin. Tthis one requires a hook clip or you can temporarily solder a jumper wire to the pin.

  2. In the Arduino IDE, Tools:

  • Board: “Arduino Nano”
  • Processor: “ATmega328P”
  1. Tools > Burn Bootlader

IMG_1693

IMG_1695

IMG_1694

3 Likes

@hiboute I just received the package from you. I have some good news. The DAVEga that you have assembled does work. Only the display headers don’t have a good contact. Maybe one of them was a bad piece or you put too much head on it while soldering and that has slightly deformed it. At any rate, I can easily fix that and ship it back to you.

The one that I have assembled is a bit of a mystery. I plugged it into the computer and tried uploading the FW to it. That worked just fine. After that I plugged in the display and at that point it stopped working. I can’t even upload the FW on it anymore. The MCU seems completely dead now. Very strange. I’ll send you a new piece.

I’ll PM you about how you want the FW pre-configured. You clearly have some problem with your Arduino IDE setup and I don’t know how to fix that.

2 Likes

Thank you for looking at it. I really appreciate it.

Are there any kits left?

I should have more soon. I’m waiting for the supply of MCUs and it seems to be stuck at customs. :frowning:

1 Like

Thanks. I’ll keep an eye out. Do I need to be on a list? Google form?

Just PM me your name and address please.

Made a simple case20190310_185442

6 Likes

Just an idea, if the large speed number could be switched out for battery amps that would be really cool. As a firmware setting option would be ok, but what would make it super awesome if they could be switched with some button combination.

1 Like

It could be done as another screen layout. You could then toggle between them with the button 3. It’s fairly straightforward. The question is if it fits in the flash memory. I’ll give it a try.

1 Like

Are you running it on an esk8?

On a goped but the trampaboards vesc was faulty so im hopfully getting a replacment soon

1 Like

Here’s a quick demo of what I have done: https://www.youtube.com/watch?v=cfFPBYKwKnQ

It works for the horizontal mode as well. You can select which display types you want in the config. Here’s what I had for the demo. Comment out ...WITH_MOTOR_CURRENT_ENABLED if you only care about battery amps.

// Screens. Uncomment the ones you want enabled.
//#define DEFAULT_SCREEN_ENABLED 1
//#define SIMPLE_HORIZONTAL_SCREEN_ENABLED 1
//#define SIMPLE_HORIZONTAL_SCREEN_WITH_BATTERY_CURRENT_ENABLED 1
//#define SIMPLE_HORIZONTAL_SCREEN_WITH_MOTOR_CURRENT_ENABLED 1
#define SIMPLE_VERTICAL_SCREEN_ENABLED 1
#define SIMPLE_VERTICAL_SCREEN_WITH_BATTERY_CURRENT_ENABLED 1
#define SIMPLE_VERTICAL_SCREEN_WITH_MOTOR_CURRENT_ENABLED 1
#define TEXT_SCREEN_ENABLED 1

I still only get data from one VESC. The battery current readings are multiplied by the VESC_COUNT config option. I don’t multiply the motor current readings though. In other words, it shows the total battery current (approximately) and the connected motor current (which should be roughly the same as any other motor current). This seemed like the most intuitive way of doing it, but I don’t feel strongly about it and I’m open to discussion.

We only have 2 digits for the value. While that’s enough for speed (I don’t expect many people to go over 100 kph), it may not be enough for current (I guess some people do make 100A+ occasionally). I didn’t want to bother with adding the third digit, so there’s color coding instead. Any value between 100-200 amps is displayed in yellow. Any value over 200 amps is displayed in red. The leading digit is trimmed.

For example, 125 amps would be displayed as 25 in yellow. 235 amps would be displayed as 35 in red. (335 amps is also displayed as 35 in red, so you can’t distinguish that from 235, but I don’t expect this to be a problem for anyone… except maybe @FullMetal_Machinist :laughing:).

The code is in the display_current branch.

Nice idea @lrdesigns. I’m definitely going to use this myself.

6 Likes

It is true that i do intend to run some 350 motor amps. However this is per motor, on 4 motors combined it will be 1400 amps. You will run out of colors. Two more digits please! This is when more than one vesc are supported. Battery total current limited to about 600 amps. Only meter i am interested in for now is ordinary voltage meter, keeping everything as simple as possible.

1 Like

:exploding_head:

@janpom the new screens with amps is really awesome!! And super quick development. Can’t wait to try it.

2 Likes

Do any of the current enclosure designs take into account the extra thickness of the header on the screen? I tried the LRdesigns one and it wasn’t thick enough so I hope there is one that will work

Maybe you just need to trim the display header pins?

Which pins exactly could you point them out with an image? The pins on the top lcd side? My case has some room for them, but only if inserted the right way around, like try flipping the davega 180deg.

If it really don’t fit I would like to try and adjust my case design.

IMG_20190321_081744 IMG_20190321_081753 IMG_20190321_081816

@janpom I have already trimmed down the pins a bit, but don’t wanna go much further incase they lose contact in the header.

@lrdesigns The screen is oriented the correct way in the case. The issue could be a bad print as the case didn’t really come up well. I’m still kinda new to printing so need to work on that more

2 Likes