Shop OBEX P1 Docs P2 Docs Learn Events
Cycling Champion generator control module useing BS2 detect 12v start\stop gen. batt. chargers - Page 5 — Parallax Forums

Cycling Champion generator control module useing BS2 detect 12v start\stop gen. batt. chargers

1235711

Comments

  • I don't know where to start to amend the code I have to enter in the 219's.
    Kwinn do you know how to write code for the 219's???
  • kwinnkwinn Posts: 8,697
    Kwinn said"That actually makes it simpler. You just need to run a pair of small gauge wires from each of the battery packs to the INA219's"

    so I should just wire it the way I had it with the back of the female center positive M jack just negative from batteries BLACK to Vin- blue header
    positive from battery bank RED to Vin + ???????

    no .01 ohm resistor???

    No resistor required but do NOT connect anything to the Vin-. You will FRY the board if you connect the battery minus there.
  • kwinnkwinn Posts: 8,697
    edited 2017-05-08 02:28
    @svparallax2017

    Beware of the labeling on the INA219 breakout board. It can mislead you, and cause serious damage to the board and the circuitry it is connected to. While Vin+ is a reasonable label for the input voltage you want to measure the Vin- label can be misleading. First of all it is the output of the Vin+ voltage that connects to whatever load the battery or power supply is connected to. Second, while it is a tiny bit less positive than the Vin+ it is still a positive voltage with respect to the negative terminal of the battery or power supply. Connecting a battery or power supply positive terminal to the Vin+ and the negative terminal to the Vin- would result in a very large current and smoke or flames from that 0.1 ohm shunt resistor. The board would have a good size burn or hole where the resistor was.

    Personally I think Vin- should have been labelled Vout or Vout+.
  • kwinnkwinn Posts: 8,697
    I don't know where to start to amend the code I have to enter in the 219's.
    Kwinn do you know how to write code for the 219's???

    I can help you out with that. I think it may also be possible to have the BS2 replace the two timer boards without too much effort but I need some more details on what they are doing to be sure. I have worked on automating a couple of solar and internal combustion generator systems in the past so I know a small microcontroller can do the job.
  • The tiny phillips head screws in the blue header have " Vin- and Vin+" I have them connected directly to the 8 battery bank.
    I am commenting on the "R100" side of the 219 NOT the 6 pin header side. The six pin header has Vcc connected to (+5Vdd) Vin +to BS2 (+)Vin

    Ok I will disconnect the BLACK negative from the 8 batteries to the blue header "Vin-".
    I will leave it disconnected from the blue header.

    Ok I have one wire from each blue header going into the white bread boards on seperate 5 wire connectors with nothing else connected to the blue Vin-.
    What do I plug into the runners on the bread board to wire it right??????

  • "positive voltage with respect to the negative terminal of the battery or power supply." Kwinn says

    I have four white breadboard spaces to get the "Vin+ out" or (Vin-blue header) Right.

    I don't care about "load" or "current" I just need it to read a floating voltage. When it discharges to 12.3volts I need a digital reading "1 "at relay output BS2 PIN's (P0 ,P1)
  • ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    'Autonomous generator control module '
    'Detects voltage levels activates programmed relays to start electric start generator'

    counter VAR Byte

    FOR counter = 1 TO 9

    DEBUG ? counter




    HIGH 14
    PAUSE 350
    LOW 14
    PAUSE 350


    NEXT


    DEBUG ? IN8
    DEBUG ? IN7
    DEBUG ? IN10
    DEBUG ? IN9

    IF (IN9 = 1) THEN

    HIGH 1
    HIGH 0
    HIGH 4 'Red
    LOW 3
    PAUSE 250

    LOW 4 'Green
    HIGH 3
    PAUSE 250

    HIGH 4 'RED
    LOW 3
    PAUSE 250

    LOW 4 'GREEN
    HIGH 3
    PAUSE 250

    HIGH 4 'Red
    LOW 3
    PAUSE 250

    LOW 4 'Green
    HIGH 3
    PAUSE 250

    HIGH 4 'RED
    LOW 3
    PAUSE 250

    LOW 4 'GREEN
    HIGH 3
    PAUSE 250

    LOW 4 ' Off
    LOW 3
    PAUSE 250


    ELSEIF (IN7=1)THEN


    HIGH 1
    HIGH 0
    HIGH 4 'Red
    LOW 3
    PAUSE 250

    LOW 4 'Green
    HIGH 3
    PAUSE 250

    HIGH 4 'RED
    LOW 3
    PAUSE 250

    LOW 4 'GREEN
    HIGH 3
    PAUSE 250

    HIGH 4 'Red
    LOW 3
    PAUSE 250

    LOW 4 'Green
    HIGH 3
    PAUSE 250

    HIGH 4 'RED
    LOW 3
    PAUSE 250

    LOW 4 'GREEN
    HIGH 3
    PAUSE 250

    LOW 4 ' Off
    LOW 3
    PAUSE 250

    ENDIF
    DO
    LOOP

  • What I ment is if the condition is there HIGH 0 HIGH1
  • HIGH 1 and HIGH 0 make relays connect ground to programmable timer relays. GERI timer and EAZY timer is working fine. I just need code for the 219's
    Please don't write code with out the Programmable Timer Relays. The box holes are already cut. If it ain't broke don't fix it.
    I just need the BS2 to see the 219's and "HIGH 0" and or "HIGH 1" when the 8 batteries are discharged to 12.3volts.


    I did not want to write the code for the 555 circuit because my abilities to write code is like constantly hitting my thumbs with a hammer in the dark trying to put a nail in a piece of wood with no lights to see what I am doing while hanging from a rafter in an attic full of flesh eating rats.
    There is always something highlighted with a Frenchman trying to explain.
  • kwinnkwinn Posts: 8,697
    OK its wired right.

    1st 219 is: SDA IN7 green wire, SCL IN8 yellow wire

    2nd 219 is SDA IN9 orange wire, SCL IN10 yellow wire

    P1 output relay
    P0 output relay
    P4 bi colored LED
    P3 ' '
    P14 green LED
    I think its ready for code

    1st 219 is: SDA IN7 green wire, SCL IN8 yellow wire

    2nd 219 is SDA IN9 orange wire, SCL IN10 yellow wire

    We don't need two SDA/SCL signals to talk to two INA219's. That's why we changed the address on one of them. I'm assuming that you mean IN7 and IN8 are P7 and P8 from the Basic stamp. Connect the SDA and SCL from the second INA219 to P7 and P8 as well.

    P0 RY1
    P1 RY2
    P3 bi colored LED
    P4 bi colored LED
    P14 green LED

    FYI relays 1 and 2 will be called RY1 and RY2 in the code. Can you add a description of what they are meant to do?

    I notice that you skipped P2. Is that intentional?

    The bi colored led on P3 and P4, is that a single led?

    What is the green led on P14 for?
  • kwinnkwinn Posts: 8,697
    OK, I have rewired my board to match the pinouts you posted. I have a few things to do today so I will start modifying the code when I get back home this evening.
  • Kwinn wrote"FYI relays 1 and 2 will be called RY1 and RY2 in the code. Can you add a description of what they are meant to do?"

    RY1 and RY2 connect the GERI programmable timer to ground,
    connect the EAZY duel relay programmable timer to ground.

    RY1 and RY2 start "the 9000" sequence of generator starting events

    the address of RY1 and RY2 is activated when the batteries are discharged to 12.3 volts

    again the EAZY relay connects battery to generator and momentarily pushes the remote fob "START" button for .06 seconds
    The GERI timers "T1" programming is a function 3 (countdown timer 1 to activate timer 2)
  • timer 1 is 9,000 seconds of generator "run time" it is running generating electricity for the converter chargers (2 and a half hours)

    then after that length of time automatically momentarily pushes the generator fob "STOP" button for .06 seconds to shut the generator off

    GERI programmable single relay timer is "programmed for function 0003"
  • Kwinn asked "I notice that you skipped P2. Is that intentional?" My answer to that is I have elephant size fingers that is why I did not use P1.
    Space on the bread board.
  • Both programmable timers have constant 12 volts. I could only activate them with a 3904 connection to ground. I used 2 micro pc board relays. They
    are smaller and require much less current to activate than the original 40amp automotive relay.
  • Kwinn asked "The bi colored led on P3 and P4, is that a single led?" Yes that is only one single "bi colored" led. That single LED is GREEN and RED.
  • Kwinn asked "What is the green led on P14 for? "

    The GREEN LED is a parallax program that I patched in to blink the LED 9 times indicating on the outside of the Mouser box enclosure that the program is started running.

    The name of the generator wireless remote fob micro controller is ............."The 9,000"
    blinks 9 times I know it had a brownout ,power interruption to the board or it has been reset. It is now started monitoring the battery voltage because I see it has blinked 9 times.
  • Kwinn's software engineering advice is..............."We don't need two SDA/SCL signals to talk to two INA219's. That's why we changed the address on one of them. I'm assuming that you mean IN7 and IN8 are P7 and P8 from the Basic stamp. Connect the SDA and SCL from the second INA219 to P7 and P8 as well."

    Kwinn I will reconnect the second 219's SDA and SCL into one I2C address (IN7 and IN8).
    I will make pin 7 and 8 have jumpers into a five panel white breadboard header. This will make both sensors I2C 4 hardware wires communications at the same 7&8 address.
  • ok both SCL wires are now pin8

    both SDA wires are now pin7

    INPUT pin 7 has short red jumper wire to white bread board
    white breadboard has orange and green wires

    INPUT pin 8 has short yellow jumper wire to white bread board
    white breadboard has two yellow SCL wires from 219 sensors


  • This is one of the relays that is turned on by the BS2
  • believe it or not the EAZY unit could do most of the job on it own as a stand alone unit.


  • this is the other Programmable Timer Relay the GERI is also activated by a micro pc board relay on the BS2 breadboard.
  • Both P.R.T.'s connect three circuits at voltage reading of 12.3volts from battery bay

    Generator to battery switch

    momentary START button

    momentary STOP button

    The BS2 could do it all by itself but that would not be so EAZY.

  • kwinnkwinn Posts: 8,697
    RY1 and RY2 connect the GERI programmable timer to ground,
    connect the EAZY duel relay programmable timer to ground.

    RY1 and RY2 start "the 9000" sequence of generator starting events

    the address of RY1 and RY2 is activated when the batteries are discharged to 12.3 volts

    again the EAZY relay connects battery to generator and momentarily pushes the remote fob "START" button for .06 seconds
    The GERI timers "T1" programming is a function 3 (countdown timer 1 to activate timer 2)
    timer 1 is 9,000 seconds of generator "run time" it is running generating electricity for the converter chargers (2 and a half hours)

    then after that length of time automatically momentarily pushes the generator fob "STOP" button for .06 seconds to shut the generator off

    GERI programmable single relay timer is "programmed for function 0003"

    Sounds to me like you could have the BS2 board activate RY1 for .06 seconds to push the generator fob "START" button, wait for 9000 seconds or until battery pack reaches the "full charge" voltage, then have RY2 push the generator fob "STOP" button.

    That means the two programmable relays are not required so fewer things to go wrong and possibly a fuel saving since the generator is only running as long as it takes to charge the batteries.
  • kwinnkwinn Posts: 8,697
    Kwinn asked "The bi colored led on P3 and P4, is that a single led?" Yes that is only one single "bi colored" led. That single LED is GREEN and RED.

    Is that led inside the case or visible outside the case?

    Do you want to use it to indicate something?
  • kwinnkwinn Posts: 8,697
    Kwinn asked "What is the green led on P14 for? "

    The GREEN LED is a parallax program that I patched in to blink the LED 9 times indicating on the outside of the Mouser box enclosure that the program is started running.

    The name of the generator wireless remote fob micro controller is ............."The 9,000"
    blinks 9 times I know it had a brownout ,power interruption to the board or it has been reset. It is now started monitoring the battery voltage because I see it has blinked 9 times.

    What would you like that led to do now? Same thing?
  • Both LEDs are visible from outside the box............the green one indicates that the voltage monitoring software program has started running.
    The bi colored LED indicates that the software conditions have been met and it is now working to start the address.
  • The point of having two digital counters to look at is that you can see what they are doing from outside the box.
    If you put all your eggs into one basket its more likely to fail.
    I have already cut the top of the box with shiny black frames around the two counters.
    It will be helpful to open a dark cabinet and see the digital counters to know where it is in the cycle.
    "How much longer are you going to have to run that noisy generator Mr?" people could ask me this question
    With the two timer windows I can see how long.
  • The red led digital counters are much easier on the eyes in the dark than that green black Bee Bot Led display
  • If I have to take the unit back out of my RV and reprogram its better. Then I just remove 4 screws and remove the top. All the buttons to reprogram the timers are right there.

    What if I find out I need more run time to charge the batteries? What if I only need to run the generator for 4500 seconds?
Sign In or Register to comment.