Motorbike battery as a power source for particle electron

Hi,

I am completely new to electronics, I have a software background. I am planning to build a motorbike GPS tracker with Particle Electron and also a remote kill-switch. I would like to use motorbike’s battery to power the particle board when engine is running and charge its LiPo battery. When engine is not running particle will be powered by LiPo battery. Vehicle battery in this case would be 12V DC. Can I connect particle directly with the battery?

My second question is how can I put together a kill-switch wiring one of particle’s digital output pins to the ignition of the bike. What sort of circuit I will need?

I have been doing a lot of reading online about using relays to connect particle with motorbike’s electrical wiring etc. but I couldn’t find any concrete examples of my particular case. Can somebody suggest circuit diagrams or figures to illustrate how I can set this all up?

Thanks

The Electron has a max input voltage of 12v. So you are going to need to drop down the battery voltage to 12v or below to not go over 12v.

Something like this would work:

Here are some relay options to take a look at for the Kill Switch:

1 Like

Thanks @RWB for the information. The step down voltage regulator will really make life simpler otherwise I was looking at some really complicated circuit diagram examples that were really not making much sense to me. Having said that I am not really sure how to put it together with electron board. Can you help with a schematic/diagram? Sorry I forgot to mention i will be using asset tracker shield. Can I connect the regulator to screwed input terminal on the shield instead of electron?

For kill switch the relays at the link you shared, which one can I use, provided that I will be using the asset tracker shield and electron would be mounted on that shield.

Yes you can connect the 5v output + and - from the buck regulator to the + and - screw down terminals on the Asset tracker.

Check out this link for more info on the Asset Tracker Sheild.

https://docs.particle.io/datasheets/particle-shields/#electron-asset-tracker

Which relay will depend on how much current the line you will be using to kill the motorcycle will need to carry.

Automotive voltages are a bit more temperamental than the figures (e.g. 12C DC) give away :wink:
Although on a motorcycle you might not see the same extremes as in a car, but have a look at this thread

@ScruffR Thanks for pointing this out. As I mentioned I am new to hardware and electronics. I am already Struggling with understanding all the terminology and rules. Your comments made sense and I would certainly want to handle this case in my design. What do you think about the regulator that @RWB proposed? Would it not handle these transients that we are talking about? If not, how I can I go about adding a solution to this in my design? Thanks.

The regulator I linked you to will accept up to 35v and operate properly on the motorcycle or vehicle so no need to worry or start looking for anything different.

I would bet your odds of some overvoltage event damaging the buck regulator are about the same as you getting hit by lightning in your lifetime. It could happen, but it’s highly unlikely :smiley:

1 Like

okay I understand, I will probably talk to a motorbike electrician to use a multi-meter to find that out for me because I absolutely don’t have any idea how to do it on my own :smile:. Ok, once I find out and I chose a relay from the list you provided, how can I connect it ? For example the relay is something like the following

https://s3.amazonaws.com/controleverything.media/styles/product_page_lightbox/s3/controleverything/Production%20Run%2013/30_PCA9536_I2CR_R11/Photos/PCA9537_I2CR_R11_A_2.png?itok=wNFs-oXD

It has an I2C port and comes with a cable. My Electron device would already be mounted on the Asset Tracker shield so how would I connect this relay to my Electron?

Thanks

Cheers @RWB, one issue resolved.On to the kill-switch and relays now :smile:

1 Like

There are actually lots of options when it comes to controlling signals so I would recommend first figuring out what is the lowest current signal line you can use to Disable the bike and then start to look at all your options for controlling that signal. There are smaller solutions out there that will work also.

I think I get it, looking at Electron’s PIN labels PARTICLE ELECTRON PIN MAP v002, I can see that we can use pins D0 and D1 for SDA and SCL respectively. But as you said, better not jump the gun and handle everything in the right order.

Yes, your right about using the I2C lines on the Electron to control that relay.

You proabaly do not want to use I2C in an automotive contex as a start for your electronic career. There are good reason as to why I2C is not used to any great extent in the automotive industry other than in circuit. It is extremely sensitive to electrical interference and stray capacitance.

Just use a dumb relay and a fly back diode. http://www.instructables.com/file/FOLEWR3G1QWARRC/

1 Like

Oh great! Thanks @janjoh. I assume this flyback diode is to protect the particle from frying by some sort of reverse current coming its way :smile:

Correct. Such a spike is generated every time the relay turns off.

I’ve had a motorbike stolen (and a couple knocked over) and have been working on a tracker. I have a couple suggestions:

  • Use a commercial battery pigtail to USB. If it’s safe enough for your cell phone or GPS, it’s safe enough for your Electron. Put the usb port in your luggage (top case or side cases). It’s pretty common for ADV/touring riders to stow their cell phones in luggage to keep it dry so it won’t look conspicuous.
  • I highly do not recommend wiring in kill switch capability. You don’t want your relay tripping when you are driving. Besides, most bike thieves don’t ride off with your bike due to the prevalence of rfid key ignition locks already present in modern bikes. They are more likely to throw it in a van, sit it in a warehouse and then chop it up for parts. The other thing they are good at doing is first removing the seat and ripping out everything connected to the battery to defeat any battery powered GPS systems.
  • Use the asset tracker kit. Also, I wrote a library to grab assisted GPS lock data via ftp and send it to the GPS for faster lock time. Otherwise, it may take a long time to get first lock and your bike might already be gone.
1 Like

@jychuah, great advice! Any chance you can share that library for grabbing the assisted GPS lock data? :grinning:

Thanks @jychuah for the battery to usb tip. I might use this one, looks more neat.
For kill switch, the application is for bike rental where customers would need to hit ‘start rental’ on the app to activate bike (which is bike engine can be started now). Customers should not be able to start a bike until they hit ‘start rental’ button from their smartphone app. My plan is to use kill switch when they hit this button from their app. To avoid risk of accidents with relay tripping while riding. I plan to wire relay so that iginition circuit is complete when DOUT is LOW. Ignition will be disabled with DOUT set to HIGH. So hopefully even if electron dies while riding, it will not shut the engine off. Hope this makes sense. Apologies if the terminology is confusing as I am a newbie to electronics etc.

I plan to use asset tracket kit. Infact I just got it in the post today. Just finished connecting it and breathing cyan :smile:

That is not an explanation you want to give when an accident does happen which the kill switch is responsible for. Extreme precautions should be taken if you want to go through with the kill switch, since you'll be responsible for it. Wouldn't it be easier to just not give them, I dunno, the keys until they've agreed with whatever it is what you want them to agree to?

Alright, we can ensure that the kill-switch is activated only when bike is not moving for some X amount of threshold time. Still there is the possibility of a software/hardware glitch that can activate it while bike is moving :frowning:

Another possibility is we can lock/unlock the saddle of the bike using electron and keys/helmets can be placed inside the saddle compartment. So once a customer has unlocked the saddle, this can be taken as an indication for rental start? What you guys think of this? An body if have better ideas please share. I want an explicit signal from the app to start the rental and use it make the bike ‘useable’ and once they are done, hit ‘end rental’ which should make the bike unusable.

Kill-switch seems a very good choice for this sort of application as it can render the bike operational or disabled. But with risks attached to it I am begining to explore other possibilites.

Thanks people for drawing my attention to this.