New User Get $30 User Coupons https://jlcpcb.com/CYT
Other Users Get SMT Coupons via Contacting JLCPCB Facebook
The potentiometer position is converted into a Watts value and transmitted over the radio link.
Subscribed to my 2nd channel? Watch all my 3 minute videos on Julian's Shorts: https://www.youtube.com/channel/UCeewzdnwcY5Q6gcbnZKIY8g
Interested in my new garden workshop? Follow the entire build on Julian's Shednanigans:
https://www.youtube.com/channel/UCXfDjPehpC7B7lW2JFxeS4w
Join me on Odysee/LBRY: https://lbry.tv/$/invite/ @julian256:d
Octopus Energy referral link: share.octopus.energy/aqua-birch-918
(We each get £50)
#EasyEVSE
#ElectronicsCreators

Morning all so i've done some more work on the evse. This is the the evse on this piece of decking timber and the first thing you may notice that the potentiometer has vanished and that's because it's no longer needed on here. It's actually been moved over to the transmitter module. Which i'll show you in a moment.

But let's plug this in and see what it does i'm plugging it into my pc. It will get five volts and it will also link up to the arduino ide. If that's what i choose to do and you can see on the display that it says zero w. Now that stands for zero watts.

Because i thought what's the best thing to transmit over the wireless data link why not what because at the transmitter end it will be measuring solar power coming off my roof solar array in watts and at this end. It'll be telling the car to charge uh with a certain number of watts. The same number of bots really to match the output from the solar array. So let's now get the transmitter switch it on and see what happens on the display.

So here's the transmitter. It's another arduino. It's got an n. Written on the chip.

Because this has the new bootloader. Whereas. This one has an o written on the chip. Because this one happens to have the old bootloader because the nano can have either it can be quite confusing.

But there's the potentiometer. It's hooked up to this arduino with a radio tower. So i can twiddle this pot. And then the transmitter talks to the receiver and the date appears on there.

So i'm just going to use this uh. Power tool battery with a usb topper unit to power up the transmitter. Let's switch that on transmitter powers up and now what we've got on the display here is 1380 watts. And if i turn up the pot you can see that goes up with some nice granularity actually to 2300 watts uh.

It doesn't quite get there it's two two nine nine. I just don't think the pots quite making it to five volts. But there we are 2300 watts. All the way down to 1380 watts.

And now these two units are completely separate and communicating via this radio link. So why 1380 watts up to 2300 watts. Well you probably remember seeing these by little tables of uh power that the car will charge at at various different currents and so i've set it to run between 1380 watts for 6 amps. At 230 volts ac.

All the way up to 2300 watts. That's 10 amps at 230 volts ac. So that's the range that explains the range of what values that show up on this display 2300 all the way down to 1380 now the difference between these two numbers is 900 and something and so the pot values. Where there are 1024 different values are mapped to the 900 or so values for the different what values and that means that we've got good granularity.

I think it goes down to a granularity of one so one four seven two one four seven three four five six. So yes you can control this uh in a very fine fine grained control down to an individual what so why did i just decide to send what over the radio link well. I thought well i could put the pot value now of course the pot itself is analog 0. To 5 volts.
The analog to digital converter inside this micro controller gives us a range of numbers between 0. And 1023. I could have said sent those numbers over the radio. But they're not very well for one thing.

The pots not going to be on the final version of this project. This arduino is going to take its input from some sort of device that measures power coming from the solar panels. The pot is only temporary so i thought well what figure what number is going to exist on this project right through to the end and of course. It's what it's the amount of watts coming off my solar array that can go up to 3600.

Incidentally this limit of where's my pot yes. There turn the pot this limit of 2300 watts is only temporary while i'm still using a power bank because this evse has no safety features because the power bank. Really can't go much above that without cutting out. So.

This is a temporary range of 6 amps. To 10 amps in the final. Version this will go from 6 amps to 16. Amps which is 36.

Kilowatts. So yeah. My decision to send watts. Is because watts is a much more meaningful number.

When this project is complete. And so yes i'm sending what it's um. It's a 16 bit number. It won't fit in a single byte.

So it's a two byte it's a u int. 16. Underscore t variable in the arduino code in fact why don't we take a look at the arduino code for the transmitter right now. So this is the transmitter code in its entirety everything in this sketch is visible on screen.

So if you want to copy it you can so most of this stuff is related to the rf24 radio communication system a pipe value which i've just set arbitrarily at five five five five five five. So here's a unit. 16. Underscore t for the packet now this packet is the 16 bit number.

Which holds what i could have called the variable watts. But i i called it packet because it relates more to the uh rf transmission system there's a payload and the payload is enabled here it's not actually used. But i didn't think it was necessary to cut it out because i might use it and here's another uint16. So it's another 16 bit variable for the.

Pot because that varies between. 0 and 1023. So in setup. We just get the radio running and then in loop.

There's an analog read of pin a7 now that from the analog to digital converter will return a value between 0. And 101023 so the packet that i'm going to send over the radio is the map command of the pot value that goes from 0 to 1023 and i'm mapping it to a range 1380 to 2300 and that's the power in what and then it simply write that over the radio delay for 100 milliseconds and repeat around the loop. So that's the transmitter code. Simply takes the pot value.

Which is between 0. And 1023 maps it to a what value. Which is 1380 to 2300 and sends it out over the radio continuously 10 times a second not hugely complicated what about the receiver and the evse code well the receiver. The evse the car charger part of this project will receive the what value coming in over the radio and then there has to be another map command.
Because it has to map this range of numbers 1380 to 2300 down to this range of numbers for the pulse width. Modulation hardware. And this is a very narrow range. It's from 19 to 29 hex sorry.

1 9. To 2 9. Hex. That's only 16 different values or is it 17.

It might be 17. Actually so this is the receiver and evse code. It requires two libraries. One for the oled display and one for the rf24 radio um.

I went through this last time. So i'll i'll gloss over it a bit more this time. Here's a variable called pwm. Now.

This is only an 8 bit variable because pwm on this particular arduino. The atmega328p is 8. Bit here are the two lines that double the pwm frequency from 490 hertz up to 980 and then this line tweaks it up to one kilohertz. We've got some oled set up some rf24 radio setup and then whenever.

A radio packet is received by the receiver. We display it directly on the oled because the packet coming over is an integer value. Which is what so we just simply display it and put a w. After it then we have another one of these map commands so this maps the incoming packet value.

Which is a 16 bit integer as i say it'll be somewhere between 1380 and 2300. And it maps it down to hexadecimal 19 up to hexadecimal. 29. That will have fairly uh not fine grained control.

Only 17 discrete values. I believe that is or is it 16. Someone will put me right on that and then we simply do an analog write to uh pin. Three which is the pwm pin.

I'm using to drive the cp line out to the car. And i also put this constraining to make sure that if for whatever reason. Some dodgy packet comes in and it's not between this range of values 1380 to 2300. I want to make sure that the p2 pwm cannot go outside of this range.

And so i can strain it between 19 and 29. Sorry one nine hex and two nine hex that is the receiver code in its entirety. There are no scroll bars here. If you want to copy this simply write it all down.

This is all of it so this is where the project is now we've got two arduinos. A transmitter and a receiver and uh still got the pot on here. But that will go because uh. We're going to have another method of telling this arduino.

How many watts are coming off my solar array. I'll go into that more in a later video. But i'm just going to bring the camera down now. So you can have a little closer look at that oled like so and oh just out of shot is the transmitter so i'm just going to wind that down now all the way to the pot at its bottom.

Which is 1380 watts um. I'll put the pot now halfway. Which is 1860 watts. And i'll try and tweak.
It small amount so you can see the granularity there i've got individual. What control and that's just fortunate really that the range of what values is actually smaller than the range of potentiometer measurement values. Because uh. The arduino has a 10 pip 10 bit analog to digital converter.

So 2300 at the top like i said. I can't quite get it to go up to 300 bit annoying that but there we go and 1380 watts at the bottom. So gonna take this out to my car just try it on the car it means. I can put this thing outside on the step and have the transmitter this device in the house with the power bank twiddle.

The pot watch the display of the power bank make sure it's all working then we can move on to the next step. Which is to measure the power output from my solar panel array. But that's it for this video cheerio.

By Julian

Youtuber, shed dweller, solar charge controller aficionado

13 thoughts on “Watts over the radio”
  1. Avataaar/Circle Created with python_avatars Nathan Musick says:

    After you get the current sensor working on the solar panel "transmitter" side you could add a current sensor to the EVSE. Set it up so you can see what is going on at both sides.

  2. Avataaar/Circle Created with python_avatars Robert Malsbury says:

    Hi Julian, what is the maximum distance between the transmitter and receiver to work?

  3. Avataaar/Circle Created with python_avatars Defpom's Electronics Repair says:

    With the transmitter being in an ISM band you should try to minimize the duration of transmission to reduce the amount of radio interference it will be generating to other devices on the same band, some countries actually have legal limits on transmit duration for that reason as it’s a shared radio band, can you get away with it transmitting once every couple of seconds for example?

  4. Avataaar/Circle Created with python_avatars Randall Neikirk says:

    Since map uses integer calculations you will not have intermediate problems but you do lose the end point as you noticed. Other websites recommend that you increase upper limit of the source by 1 to account for the loss in the calculation process.

  5. Avataaar/Circle Created with python_avatars Jeff Merlin says:

    Why is packet two uint16_t in an array? Seems like you never touch packet[1] 🙂

  6. Avataaar/Circle Created with python_avatars PicoNano says:

    Why not put it at 10KW, and trick reality into charging the car faster?

  7. Avataaar/Circle Created with python_avatars andymouse123 says:

    Looking good…cheers.

  8. Avataaar/Circle Created with python_avatars Pete Mundy says:

    I have a small suggestion to greatly reduce the RF transmissions – configure the transmitter to only send the bytes when the pot value has changed since last time. That way you'll only transmit when the pot is rotated rather than constantly. As easy as "if packet[0] != lastPacket[0] then" 🙂

  9. Avataaar/Circle Created with python_avatars Rory Macleod says:

    You cant send WATTS over a radio , Nicola Tesla proved that !!

  10. Avataaar/Circle Created with python_avatars David _1 says:

    Yay

  11. Avataaar/Circle Created with python_avatars hitechguy18 says:

    I would of used Both Solar Volts and Solar Watts due both are important For Charing throttle to prevent You out Stripping & Stressing your HV PV Supply (Your 20W solar panel and 20W Light bulb "& Maximum power transfer theorem Videos )

  12. Avataaar/Circle Created with python_avatars phiz says:

    Cool stuff Julian! Have you considered securing the RF comms to complicate eavesdropping/replay attacks and harden the system from radio interference?

  13. Avataaar/Circle Created with python_avatars alison carney says:

    ARE YOU GOING TO USE A CURRENT SHUNT CURRENT AS 60A SHUNT GIVES 75MA OR UP TO 5V
    OUT AND IF IN SERIES OF SOLAR PANEL OUT IT WILL SHOW CURRENT IN AND OUT ALL VALUES ARE APPROX LIKE TO SEE YOUR CODE AFTER YOU DO IT PLEASE LINK IT IN WHEN FINISHED THIS PART
    I WILL KEEP WATCHING

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.