Bosch Indego (gen.1) goes Teensy

And the comstruction works continues 🛠️ The next question is about the bumper sensor.

My idea is to use the original Indego Bumper Sensor. This is a hall effect sensor wit a magnet in the bottom of a joystick over it.
The sensor should be the Allegro A1324 in SOT23 package. I think the logic circuit on the PCB invert the output signal of these sensor.
If the magnet over the hall sensor (no bump), the output is low (around 0V). If the joystick pushed, the magnet goes away from the hall sensor (bump), the output pin (blue wire) on the Indego PCB gives +2,5V output.
Some pictures of this solution:
20240630_113233_.jpg20240630_113246.jpg20240630_113254.jpg20240702_071747.jpg
I dont know, if the output pin of the hall sensor PCB can be connected direct to the bumper pin on the Teensy and the pin can be inverted?
Maybe a pulldown activate on the Teensy pin. the 3.3V should be recognized as HIGH.

Or, I think a bit safer solution with add a small transistor, I can use it as a NO switch (same as microswitch): take a look to the PDF.
I think this second solution with the transistor will be effectiver and maybe quicker response. And also safer for the pin on Teensy. 🚭;)

The second question: this only one bumper sensor reacts overall on the chassis. Can the bumper signal evaluate together with the current state of the mower?
That means, if the mower drives forward and the bumper react, the mower stop and will drive backwards. And the bumper signal by reverse drive react in a forward mowement?
I hope you understand my bad english what I mean.o_O Thanks!
 

Attachments

It's difficult to understand your picture, but it's maybe less expensive and easier to replace the sensor by a simple KY003 module locate near the magnet.

I dont know, if the output pin of the hall sensor PCB can be connected direct to the bumper pin on the Teensy and the pin can be inverted?
Maybe a pulldown activate on the Teensy pin. the 3.3V should be recognized as HIGH.

Do you have a oscilloscope ?, if yes you can try to connect a very low cost 3.3V mcu (ESP8266 for example) and test it .
Teensy is too expensive for this kind of test .

And the bumper signal by reverse drive react in a forward mowement?

In the firmware a rear bumper is never tested or used.
In all case when mower reverse, it's after a forward movement, so normaly there is no obstacle when reverse.

But it's better (but not mandatory because in bylane mowing the roll direction is fixed)) to detect the front right or left bumper to roll in the correct direction after bump in random mowing.
 
Makes a difference if this one sensor signal connected to right or left bumper? Or should I connect to both? With two small transistors can connect to both.
 
You can connect to only one and shunt the second to GND
In this case :
if you connect to left
When mower bump,it reverse and roll clockwise

if you connect to right
When mower bump,it reverse and roll counterclockwise
 
Ok, understand.
But why short the other to GND?
The standard NO bumper switch short it also to GND, or not?
 
Ok, understand.
But why short the other to GND?
The standard NO bumper switch short it also to GND, or not?
To GND to avoid free pin and sporadique detection but you can test without any connection or like you suggest the 2 in parallel

IMPORTANT is the BUMPER_IS_SWITCH value ,
The input is direct to teensy input.
In the RL2000 platform bumper is switch, so the input have a pullup and it's the reason for grounding it when detect something.
In MI632 it's electronics KY003, so BUMPER_IS_SWITCH is false and declaration of the input don't have the pullup.


into mower.h
Code:
#define BUMPER_IS_SWITCH false  // set to true if the bumper is a single ON/OFF switch
#define BUMPER_REAR_EXIST true  // set to true to manage the rear bumper connected on CAN3 J20 connector
#define BUMPER_ARE_NORMALY_CLOSED false  // set to true if the bumper contact is closed when nothing is hit

into mower.cpp
Code:
// bumpers
  if (BUMPER_IS_SWITCH) {
    pinMode(pinBumperLeft, INPUT_PULLUP); //it's contact
    pinMode(pinBumperRight, INPUT_PULLUP);
    if (BUMPER_REAR_EXIST) {
      pinMode(pinBumperRearLeft, INPUT_PULLUP); //it's contact
      pinMode(pinBumperRearRight, INPUT_PULLUP);

    }
  }
  else
  {
    pinMode(pinBumperLeft, INPUT); //it's electronics like KY003
    pinMode(pinBumperRight, INPUT);
    if (BUMPER_REAR_EXIST) {
      pinMode(pinBumperRearLeft, INPUT); //it's contact
      pinMode(pinBumperRearRight, INPUT);
    }
  }

The standard NO bumper switch short it also to GND, or not?
YES
 
Thanks Bernard! Now I have readed this parts of the code, also in robot.cpp the // check bumpers area by 5803.
Now is clear how the bumpers are recognized. ☝️:cool:

Another thing, what I noticed currently, the position of the IMU:
IMU posi.jpg
Is this position acceptable?:rolleyes:
Or better to place it in the front of the mower, away from the motors.
And should not placed 90° rotated, with the short edges parallel in drive direction?
Or can be calibrated in this position?
 
Is this position acceptable?
Normally Yes.
Only Gyro and accel is used, so no magnetic issue from motor.
And the YAW (driving direction) is always relative, so no orientation needed

But you can test it easily without working mower:
Connect Ide console to see the result.
Into arduremote setting Imu --> do the Accel Gyro initial calibration.
Pitch and roll need to be 0 at end of process.
And you can see into setting imu value changing according manual move of mower or pcb.

here the wiki (read only the main setting part)


ONLY take care if you want to add a compass
I have dev the code for it but after many test i don't recommend it
It's magnetometer and inside a mower ,there is so many EMF that it's not possible to have a reliable result in Earth magnetic North orientation.
 
Ok, thanks! Compass is not planned by me. Normally the Gyro will enough for lane mowing. I will set the lanes not longer then 10-12m for the first. We will see. I got this part in ardumower wiki I allready, but I was unsure if the drive direction has an affect to gyro.:unsure:
Slowly I have readed the whole WIKI 👍😅

Yesterday late, it was finaly the wiring complete. (I will make it nicer after all parts works and tested on lawn.) The bumper works with the added small transistor circuit very well as a normaly switch, but I think more sensitive. (Maybe too sensitiv. I will test it and in worst case I need to damping the transistor with a R-C part. We will see in the tests.) The schematic some posts above: PDF in the attachment
Both Bumper pins are setted with internal pullups. So the second input leaved open and so always high.
First test looks good. Mower motor drive also as expected. For the firs tests I leave it the L298N for the drive motors. I can swap it later.
20240702_233131.jpg

Now, I need really as next the sender and charger integrated in the Indego station. PCB is short befor complete :)
9V and 5V are ok. Need to programm an ESP32 and search for a good place/orientation in the station case.
20240702_233055.jpg

I think one INA with R010 for charging current is ok. But is it not better for the sensing the perimeter loop an INA with R100 ?
Or it musst be both INAs the same?

UPDATE TO the INAs:
I have found the part with the INAS in Stefans "ESP32_WIFI_Sender.ino"
//********************* INA226 Settings **********************************
INA226_WE InaPeri = INA226_WE(0x40); // 0x40 = without bridge
float resistorPeri = 0.1; // for 10mOhm resistor try a value 0.02. For 100mOhm resistor use 0.1
float rangePeri = 0.8; // Range for 10mOhm Resistor: try 8.0 or 4.0 - For 100mOhm use 0.8

INA226_WE InaCharge = INA226_WE(0x44); // 0x44 = bridge between A1 and VSS
float resistorCharge = 0.02;
float rangeCharge = 4.0;
The values are a bit confusing, but I will test it...

The schematic I have allready checked in the azuritber Wiki: https://wiki.ardumower.de/index.php?title=WIFI_Perimeter_Sender(English)
With the Teensy sender PCB all is very similarly, except the INAs.;)
 
Last edited:
Ok, thanks! Compass is not planned by me. Normally the Gyro will enough for lane mowing. I will set the lanes not longer then 10-12m for the first. We will see. I got this part in ardumower wiki I allready, but I was unsure if the drive direction has an affect to gyro.:unsure:
Slowly I have readed the whole WIKI 👍😅

Yesterday late, it was finaly the wiring complete. (I will make it nicer after all parts works and tested on lawn.) The bumper works with the added small transistor circuit very well as a normaly switch, but I think more sensitive. (Maybe too sensitiv. I will test it and in worst case I need to damping the transistor with a R-C part. We will see in the tests.) The schematic some posts above: PDF in the attachment
Both Bumper pins are setted with internal pullups. So the second input leaved open and so always high.
First test looks good. Mower motor drive also as expected. For the firs tests I leave it the L298N for the drive motors. I can swap it later.
View attachment 1651

Now, I need really as next the sender and charger integrated in the Indego station. PCB is short befor complete :)
9V and 5V are ok. Need to programm an ESP32 and search for a good place/orientation in the station case.
View attachment 1653

I think one INA with R010 for charging current is ok. But is it not better for the sensing the perimeter loop an INA with R100 ?
Or it musst be both INAs the same?

UPDATE TO the INAs:
I have found the part with the INAS in Stefans "ESP32_WIFI_Sender.ino"

The values are a bit confusing, but I will test it...

The schematic I have allready checked in the azuritber Wiki: https://wiki.ardumower.de/index.php?title=WIFI_Perimeter_Sender(English)
With the Teensy sender PCB all is very similarly, except the INAs.;)
For mower it's OK.

For sender, i never test the 5V by this way ,like on my WIKI i always power the ESP32 over 5V of the L298N driver.But i hope it's OK.
DOUBLE CHECK THE + / - on charge output
For INA226 it's like you want R010 or R100 and simply adjust the resistorPeri / resistorCharge according , i use 0.01 for R010.
20240630_085107.jpg


2 very small issue:
OTA flash don't work all the time .
Take care that some screen don't work well with the library used .

I only have made some small change in the code to always see the IP adress when sender is running.
 

Attachments

For the 5V: in the newer PCB is a place for the L7805 and I forgot about it, that the L298n has the same 5V supply. But I think it does not matter where the 5V comes. 😊
Ofcourse, the charger +/- main pins are always to check it double. 😉 Otherwise the magic smoke can come out faster than you can react.:cool:🚭

Thanks for the ZIP 👌
 
I think I found a little bug on the Teensy Sender PCB. The SDA and SCL tracks are mixed up.
20240703_200949.jpg
On the main PCB V1.03 are the I2C socket also inverted. Here on this PCB should in the next version corrected, to have the same pattern as the power PCBV1.09 and the I2C connectors on the main PCB.

For me, I think will be now the simpliest solution to change the pin in the software and the text on the PCB :)
line 41 in the "ESP32_WIFI_Sender.ino"

old
#define I2C_SDA 21 // SDA pin
#define I2C_SCL 22 // SCL pin
new
#define I2C_SDA 22 // SDA pin
#define I2C_SCL 21 // SCL pin
 
Ich weiß. Wollte nur auf den Unterschied zwischen den zwei PCBs hinweisen. Sender V1.01 ist andersrum als PowerPCBv1.09 ;)
 
I have a question on the buttons. Before I finish the case, need to know how many buttons are needed.
Is it correct that:
- on the power pcb_V1.09 the J9 will be needed always for the first start after battery switched off and on?
- on the main pcb V1.03 the J14 will be needed to use the mower without pfodApp only with button? Has this button the same function as described here in the azuritBer Wiki? Button on P20
- on the main pcb the J18 (Teensy on/off) has any function?

Basically are the J9 and J14 enough to manually controll the mower?

ps: of course, one main on/off switch for the battery is needed and allready added by me (power pcb J6)
 
Yes everything is correct.
Take care that if Main timer is not actif : at the end of the charging process ,PCB is automatically switch OFF to preserve battery.
You can avoid this by set all timer to NO and keep only the main timer page to Yes.

But Pfod help a lot to know the real state of mower in command page ,and console page for real time debugging.

one main on/off switch
It's the emergency switch.
 
My station works now ok, the robot find the perimeter and can track the wire, docking and charging!🥳

But, in the browser info view has no values, or not correct values for the voltage and current:

MAC ADRESS = FC:E8:C0:7E:05:28
Current chargetime: 0min.
Last charge : 0min.
Uptime perimeterloop = 0min.
Current flow in the perimeter loop = 0.00mA
Voltage in the perimeterloop = 0.00V
Chargecurrent = 0.00mA
Chargevoltage = 8.72V
Sends one bit of the signal every :104us
Signalcode = 1
Sender A : 1
Sender B : 0
Any idea why??

Here the INA settings:
//********************* INA226 Settings **********************************
INA226_WE InaPeri = INA226_WE(0x40); // 0x40 = without bridge
float resistorPeri = 0.1; // for 10mOhm resistor try a value 0.02. For 100mOhm resistor use 0.1
float rangePeri = 0.8; // Range for 10mOhm Resistor: try 8.0 or 4.0 - For 100mOhm use 0.8
INA226_WE InaCharge = INA226_WE(0x44); // 0x44 = bridge between A1 and VSS
float resistorCharge = 0.02;
float rangeCharge = 4.0;
The top INA (10mOhm) for charging is bridged A1 to VSS. The bottom INA with 100mOhm resistor has no bridge for the adress.

And some photos from the build:
20240716_074020.jpg20240716_074025.jpg

On the PCB meassured Voltages:
V peri = 9,5V
V charge = 29,2V
Resistance of peri: 8 Ohm (wire) + 9 ohm (ceramic resistor) = 17 Ohm

The L298N will be a little bit hot in the closed housing by 32°C ambiente 🥵 I think, I will change/solder it to bridged parallel function.
 
I will change/solder it to bridged parallel function.

BE CARREFULL /
If you bridge the L298N , you need to disconnect one of the 2 input A or B or you are going to destroy it.

Normally no heat issue here ,only the power resistor is hot (50 60 deg).
 
Back
Top