# GitHub - vtpgit/Lepton-BLDC: Lepton SimpleFOC BLDC PCB Board

**URL:** https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723
**Category:** Uncategorized
**Created:** [November 30, 2022, 5:50pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723 "2022-11-30T17:50:02Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Valentine](https://community.simplefoc.com/user_avatar/community.simplefoc.com/valentine/32/1024_2.png) [@Valentine](https://community.simplefoc.com/u/Valentine)
#### Post date: [November 30, 2022, 5:50pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/1 "2022-11-30T17:50:02Z")

</div>

By popular request, I created a small How-To order repository for the Lepton boards.

[https://github.com/vtpgit/Lepton-BLDC](https://github.com/vtpgit/Lepton-BLDC)

The public shares for the Lepton Boards:

2-Layer

[https://oshwlab.com/cost.co/20220903\_bldc\_se3082g](https://oshwlab.com/cost.co/20220903_bldc_se3082g)

or

4-Layer

[https://oshwlab.com/cost.co/20220903\_bldc\_se3082g\_copy](https://oshwlab.com/cost.co/20220903_bldc_se3082g_copy)

Instead of cloning the order from OSHWLab, you could also use the Gerber, BOM and centroid files from the GitHub repository directly.

Open loop code to demo / test the board:

```auto
#include <SimpleFOC.h>
BLDCMotor motor = BLDCMotor(1);
BLDCDriver6PWM driver = 
BLDCDriver6PWM(PA8, PA7, PB3, 
               PB0, PB6, PB1);
float target_velocity = 1.0;
float target_voltage = 2.0;
void setup() {
  driver.voltage_power_supply = 12;
  driver.pwm_frequency = 15000;
  driver.init();
  motor.linkDriver(&driver);
  motor.voltage_limit = 12; // [V]
  motor.velocity_limit = 100; // [rad/s]
  motor.controller = 
  MotionControlType::velocity_openloop;
  motor.init();
  _delay(1000); }
void loop() {
  motor.voltage_limit = target_voltage;
  motor.move(target_velocity); }

```

The same code is printed on the back of the PCB silk screen of the 4-layer board.

Cheers,  
Valentine

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 3, 2023, 12:04am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/2 "2023-02-03T00:04:39Z")

</div>

I will try to follow this asap. Tomorrow at the latest. JLCPCB is making me redo the order. Also I need to make sure the encoder boards have the standard mouting and chip position. It is a 24 mm square, with the chip exactly in the middle of the square.

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 3, 2023, 12:06am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/3 "2023-02-03T00:06:02Z")

</div>

What software did you use to make the 3 files? I can use them to modify them and produce new downstream files.

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 3, 2023, 12:09am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/4 "2023-02-03T00:09:46Z")

</div>

oh, this is the lepton. software - easy EDA, looks like cool software. Do you have the design for those encoders? I need that…

---

<div class="post-metadata">

### Author: ![Valentine](https://community.simplefoc.com/user_avatar/community.simplefoc.com/valentine/32/1024_2.png) [@Valentine](https://community.simplefoc.com/u/Valentine)
#### Post date: [February 3, 2023, 12:10am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/5 "2023-02-03T00:10:09Z")

</div>

> [@Anthony\_Douglas](#):
>
> What software did you use to make the 3 files

EasyEDA. Open the third link.

> [@Anthony\_Douglas](#):
>
> Do you have the design for those encoders?

Let me check.

[https://oshwlab.com/cost.co/20220207\_angle\_sensor\_sc60228dc](https://oshwlab.com/cost.co/20220207_angle_sensor_sc60228dc)

Cheers,  
Valentine

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 3, 2023, 12:22am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/6 "2023-02-03T00:22:57Z")

</div>

ok, I read the guide at [https://community.simplefoc.com/t/ordering-a-mosquito-bldc-board-from-jlc-step-by-step/2120/5](https://community.simplefoc.com/t/ordering-a-mosquito-bldc-board-from-jlc-step-by-step/2120/5) and will get started, I will go for the 2 layer board, I think that’s more suitable. I only need like 2 amps max. Hope I don’t need any part substitutions…

---

<div class="post-metadata">

### Author: ![Valentine](https://community.simplefoc.com/user_avatar/community.simplefoc.com/valentine/32/1024_2.png) [@Valentine](https://community.simplefoc.com/u/Valentine)
#### Post date: [February 3, 2023, 12:24am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/7 "2023-02-03T00:24:56Z")

</div>

> [@Anthony\_Douglas](#):
>
> Hope I don’t need any part substitutions

If you need any ask. I will find the synonyms. Cheers, Valentine

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 3, 2023, 1:36am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/8 "2023-02-03T01:36:00Z")

</div>

All went ok! 🙂 Looking forward to testing :). I noticed the actual source code isn’t really the gerber or bom or centroid files, it is inside eda. I don’t know how one would get it out. Modifying the design for the encoders would not have really been possible if I had not been able to simply load up a copy of the file from the cloud.

To be fair, the schematic could be recreated in EAGLE or some other editor which is more independent, I guess. Perhaps I could import the schematic or something some other time. At least it is up on github.

I ordered 20 encoders but only 10 leptons, because seems like significant chance I will have to change at least one minor thing, and if not I can order more without too much difficulty. Always a bit of a gamble, tempting to order more hoping to save money later but in my experience that rarely works out. I may try to change the connectors to 2.54 mm pitch screw terminal connectors, I don’t like having to source connectors to access things. I would have tried this time around but it’s not a simple substitution as they are twice the size and I don’t want to mess with something I don’t understand before at least testing. My priority is to get out of the woods and know which way to even go.

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 3, 2023, 1:48am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/9 "2023-02-03T01:48:32Z")

</div>

BTW, can I ask what’s the CK pin on the plug for the encoder for? There is no corresponding pin on the encoder…

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 3, 2023, 3:48am UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/10 "2023-02-03T03:48:49Z")

</div>

Yeah, to get a 6 pin 1.25 mm pitch picoblade connector with 600 mm leads is $8.8. They want $5.6 each for the 4 pin ones, similar for smaller prices. I’m definitely going to have to switch things over to 2.54 mm pitch, either dupont or screw terminals can then be used. In the meantime I will buy some 6 pin connectors and the cheapest 4 pin, just a couple for prototyping. Shit. Whatever, all part of the process I guess. Amazon has some little adapter kits, I will probably get one of those, they should be useful in the future anyway.

Why is it that components are easier to get on amazon than digikey… both the 1.25mm connectors and the 5 mm screw terminals are a fraction the price on amazon, and there is way more variety… The idea of a supplier that effectively supplies a respectable selection of electronics parts seems to have eluded these people. Same story with voltage regulators, servos, motor driver boards…

---

<div class="post-metadata">

### Author: ![Valentine](https://community.simplefoc.com/user_avatar/community.simplefoc.com/valentine/32/1024_2.png) [@Valentine](https://community.simplefoc.com/u/Valentine)
#### Post date: [February 3, 2023, 2:27pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/11 "2023-02-03T14:27:23Z")

</div>

> [@Anthony\_Douglas](#):
>
> CK pin on the plug for the encoder

That’s the SPI Clock, the pin is SCLK, there wasn’t enough space to put four characters on the silk screen.

---

<div class="post-metadata">

### Author: ![Valentine](https://community.simplefoc.com/user_avatar/community.simplefoc.com/valentine/32/1024_2.png) [@Valentine](https://community.simplefoc.com/u/Valentine)
#### Post date: [February 3, 2023, 2:28pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/12 "2023-02-03T14:28:44Z")

</div>

> [@Anthony\_Douglas](#):
>
> get a 6 pin 1.25 mm pitch picoblade connector with 600 mm leads is $8.8

You can order without the connectors and directly solder wires.

---

<div class="post-metadata">

### Author: ![dekutree64](https://community.simplefoc.com/user_avatar/community.simplefoc.com/dekutree64/32/3398_2.png) [@dekutree64](https://community.simplefoc.com/u/dekutree64)
#### Post date: [February 3, 2023, 4:59pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/13 "2023-02-03T16:59:26Z")

</div>

Search “4-pin 1.25mm jst” on ebay and you’ll get a bunch to pick from. None with 600mm leads though. You’ll have to solder extension wires yourself. 100 of them for about $15 here, and even includes the male connectors to solder to the boards (if you exclude them on the JLC order to save the hand soldering fee) [100Pcs Micro JST 4Pin Spacing 1.25mm Single End 15cm Wire To Board Connector | eBay](https://www.ebay.com/itm/153988922628)  
There are some with 30cm leads, so if you don’t have suitable wire on hand, you could buy those, cut the wires off one, and use them to extend another. Leave a couple cm of wire on the donor cable so you can still solder to it in the future rather than throwing it away.

And if you need different pin counts, you can save a bit of money by buying one type of cable with wires from ebay, and empty connector housings from LCSC such as [HC-1.25-4Y HCTL | Connectors - LCSC Electronics](https://www.lcsc.com/product-detail/Rectangular-Connectors-Housings_HCTL-HC-1-25-4Y_C2962291.html)  
Then harvest wires from the ebay cables and stick them in those housings. I wish I had been smart enough to do that instead of buying 9-pin with wires when I already had a pile of 6-pin 🙂

---

<div class="post-metadata">

### Author: ![Valentine](https://community.simplefoc.com/user_avatar/community.simplefoc.com/valentine/32/1024_2.png) [@Valentine](https://community.simplefoc.com/u/Valentine)
#### Post date: [February 3, 2023, 7:35pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/14 "2023-02-03T19:35:35Z")

</div>

> [@dekutree64](#):
>
> None with 600mm leads though

60cm SPI sensor wire requires twisted pairs and shielding. SPI doesn’t work reliably over such a long distance unless precautions are made, especially with higher data rates. He will need probably a cat-8 cable or a USB cable which already have TP shielded wires for that, and the eyes and patience of a neurosurgeon to solder them on the connectors.

---

<div class="post-metadata">

### Author: ![runger](https://community.simplefoc.com/user_avatar/community.simplefoc.com/runger/32/395_2.png) [@runger](https://community.simplefoc.com/u/runger)
#### Post date: [February 3, 2023, 7:38pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/15 "2023-02-03T19:38:40Z")

</div>

> [@Valentine](#):
>
> and the eyes and patience of a neurosurgeon to solder them on the connectors.

🤣

Or a decent microscope…

---

<div class="post-metadata">

### Author: ![Anthony\_Douglas](https://community.simplefoc.com/user_avatar/community.simplefoc.com/anthony_douglas/32/2300_2.png) [@Anthony\_Douglas](https://community.simplefoc.com/u/Anthony_Douglas)
#### Post date: [February 4, 2023, 4:05pm UTC](https://community.simplefoc.com/t/github-vtpgit-lepton-bldc-lepton-simplefoc-bldc-pcb-board/2723/16 "2023-02-04T16:05:03Z")

</div>

hm, uh oh, thanks for the heads up. I will have to deal with that somehow. I think I can get wire length down to 20 cm.
